pub async fn connect(self) -> anyhow::Result<ConnectedOrchestrator<Fuse<TryJoinAll<LF>>>> {
        let Orchestrator {
            mut processes,
            bridges,
            loggers,
            ..
        } = self;
        let processes: Vec<BFR<()>> = processes
            .drain()
            .map(|(_k, v)| v)
            .map(may_exit_process_handler)
            .collect();

        // Main future executor, had to implement due to customized pipeline
        // Wait for all bridges to connect to server and pass ipc handles
        let bridges = try_join_all(bridges).fuse();
        // Wait for all logs to complete or any of them to fail
        let mut loggers = Box::pin(try_join_all(loggers).fuse());
        //let i: u32 = loggers;
        // Wait for all processes to complete or any of them to fail
        let mut processes = Box::pin(try_join_all(processes).fuse());
        pin_mut!(bridges);

        let res = select!(
            res = bridges => match res {
                Ok(channels) => { Ok(channels) },
                Err(err) => { error!("failed to establish connection: {}", err); Err(err.into()) }
            },
            res = processes => should_not_complete!("processes", res),
            res = loggers => should_not_complete!("logs", res),
        );

        match res {
            Ok(channels) => Ok(ConnectedOrchestrator::new(channels, processes, loggers)),
            Err(err) => {
                error!(target: "orchestrator", "{}", &err);
                Err(err)
            }
        }
    }
/// Connect to processes IPC channels
/// Resulting ConnectedOrchestrator can be used to further setup handlers
/// over processes bridges
Connect to processes IPC channels
Resulting ConnectedOrchestrator can be used to further setup handlers
over processes bridges
Connect to processes IPC channels Resulting ConnectedOrchestrator can be used to further setup handlers over processes bridges
pub async fn connect(self) -> anyhow::Result<ConnectedOrchestrator<Fuse<TryJoinAll<LF>>>> {
        let Orchestrator {
            mut processes,
            bridges,
            loggers,
            ..
        } = self;
        let processes: Vec<BFR<()>> = processes
            .drain()
            .map(|(_k, v)| v)
            .map(may_exit_process_handler)
            .collect();
        // Main future executor, had to implement due to customized pipeline
        // Wait for all bridges to connect to server and pass ipc handles
        let bridges = try_join_all(bridges).fuse();
        // Wait for all logs to complete or any of them to fail
        let mut loggers = Box::pin(try_join_all(loggers).fuse());
        //let i: u32 = loggers;
        // Wait for all processes to complete or any of them to fail
        let mut processes = Box::pin(try_join_all(processes).fuse());
        pin_mut!(bridges);
        let res = select!(
            res = bridges => match res {
                Ok(channels) => { Ok(channels) },
                Err(err) => { error!("failed to establish connection: {}", err); Err(err.into()) }
            },
            res = processes => should_not_complete!("processes", res),
            res = loggers => should_not_complete!("logs", res),
        );
        match res {
            Ok(channels) => Ok(ConnectedOrchestrator::new(channels, processes, loggers)),
            Err(err) => {
                error!(target: "orchestrator", "{}", &err);
                Err(err)
            }
        }
    }
pub async fn connect ( self ) -> anyhow :: Result < ConnectedOrchestrator < Fuse < TryJoinAll < LF > > > > { let Orchestrator { mut processes , bridges , loggers , .. } = self ; let processes : Vec < BFR < ( ) > > = processes . drain ( ) . map ( | ( _k , v ) | v ) . map ( may_exit_process_handler ) . collect ( ) ; // Main future executor, had to implement due to customized pipeline // Wait for all bridges to connect to server and pass ipc handles let bridges = try_join_all ( bridges ) . fuse ( ) ; // Wait for all logs to complete or any of them to fail let mut loggers = Box :: pin ( try_join_all ( loggers ) . fuse ( ) ) ; //let i: u32 = loggers; // Wait for all processes to complete or any of them to fail let mut processes = Box :: pin ( try_join_all ( processes ) . fuse ( ) ) ; pin_mut ! ( bridges ) ; let res = select ! ( res bridges match res { Ok ( channels ) { Ok ( channels ) } Err ( err ) { error ( " " err ) Err ( err into ( ) ) } } res processes should_not_complete ( " " res ) res loggers should_not_complete ( " " res ) ) ; match res { Ok ( channels ) => Ok ( ConnectedOrchestrator :: new ( channels , processes , loggers ) ) , Err ( err ) => { error ! ( target " " " " err ) ; Err ( err ) } } }
Connect to processes IPC channels
Resulting ConnectedOrchestrator can be used to further setup handlers
over processes bridges
Connect to processes IPC channels Resulting ConnectedOrchestrator can be used to further setup handlers over processes bridges
self
self