pub(crate) fn deploy_artifact(
        &mut self,
        artifact: ArtifactId,
        payload: Vec<u8>,
    ) -> impl Future<Item = (), Error = ExecutionError> {
        // TODO: revise dispatcher integrity checks [ECR-3743]
        debug_assert!(artifact.validate().is_ok());

        if let Some(runtime) = self.runtimes.get_mut(&artifact.runtime_id) {
            let runtime_id = artifact.runtime_id;
            let future = runtime
                .deploy_artifact(artifact, payload)
                .map_err(move |mut err| {
                    err.set_runtime_id(runtime_id);
                    err
                });
            Either::A(future)
        } else {
            Either::B(future::err(CoreError::IncorrectRuntime.into()))
        }
    }
/// Initiate artifact deploy procedure in the corresponding runtime. If the deploy
/// is successful, the artifact spec will be written into `artifact_sources`.
///
/// # Panics
///
/// * If artifact identifier is invalid.
Initiate artifact deploy procedure in the corresponding runtime. If the deploy
is successful, the artifact spec will be written into `artifact_sources`.
Initiate artifact deploy procedure in the corresponding runtime . If the deploy is successful the artifact spec will be written into ` artifact_sources ` .
pub(crate) fn deploy_artifact(
        &mut self,
        artifact: ArtifactId,
        payload: Vec<u8>,
    ) -> impl Future<Item = (), Error = ExecutionError> {
        // TODO: revise dispatcher integrity checks [ECR-3743]
        debug_assert!(artifact.validate().is_ok());
        if let Some(runtime) = self.runtimes.get_mut(&artifact.runtime_id) {
            let runtime_id = artifact.runtime_id;
            let future = runtime
                .deploy_artifact(artifact, payload)
                .map_err(move |mut err| {
                    err.set_runtime_id(runtime_id);
                    err
                });
            Either::A(future)
        } else {
            Either::B(future::err(CoreError::IncorrectRuntime.into()))
        }
    }
pub ( crate ) fn deploy_artifact ( & mut self , artifact : ArtifactId , payload : Vec < u8 > , ) -> impl Future < Item = ( ) , Error = ExecutionError > { // TODO: revise dispatcher integrity checks [ECR-3743] debug_assert ! ( artifact validate ( ) is_ok ( ) ) ; if let Some ( runtime ) = self . runtimes . get_mut ( & artifact . runtime_id ) { let runtime_id = artifact . runtime_id ; let future = runtime . deploy_artifact ( artifact , payload ) . map_err ( move | mut err | { err . set_runtime_id ( runtime_id ) ; err } ) ; Either :: A ( future ) } else { Either :: B ( future :: err ( CoreError :: IncorrectRuntime . into ( ) ) ) } }
Initiate artifact deploy procedure in the corresponding runtime.
Initiate artifact deploy procedure in the corresponding runtime .
&mut self
artifact
ArtifactId
payload
Vec<u8>
&mut self
artifact
ArtifactId
payload
Vec<u8>
panics
If artifact identifier is invalid.
If artifact identifier is invalid .