pub fn configure(settings: &settings::Settings, components: &[ComponentInfo]) -> Result<Vec<CoordinatorInfo>, ComponentError> {
    let mut active_coordinators: Vec<CoordinatorInfo> = Vec::new();
    for c in &settings.coordinator {
        // c is the coordinator HashMap
        for k in c.keys() {
            let result = match k.as_str() {
                "EchoCoordinator" => echo_coordinator::configure(settings, components),
                "ChatCoordinator" => chat_coordinator::configure(settings, components),
                "MonitorCoordinator" => monitor::configure(settings, components),
                "AliceCoordinator" => alice::configure(settings, components),
                "UdpEchoCoordinator" => udp_echo_coordinator::configure(settings, components),
                _ => {
                    log::warn!("unhandled {:#?} coordintor configuration", k);
                    Ok(None)
                },
            };
            if let Err(e) = result {
                return Err(e);
            }
            if let Ok(Some(sender)) = result {
                active_coordinators.push(CoordinatorInfo::new(k.clone(), sender))
            }
        }
    }
    Ok(active_coordinators)
}
/// coordinators (I dislike the name) assemble components to form a service.
/// The idea being that they have an understanding of what's needed and can
/// call upon components to create instances.
coordinators (I dislike the name) assemble components to form a service.
The idea being that they have an understanding of what's needed and can
call upon components to create instances.
coordinators ( I dislike the name ) assemble components to form a service . The idea being that they have an understanding of what ' s needed and can call upon components to create instances .
pub fn configure(settings: &settings::Settings, components: &[ComponentInfo]) -> Result<Vec<CoordinatorInfo>, ComponentError> {
    let mut active_coordinators: Vec<CoordinatorInfo> = Vec::new();
    for c in &settings.coordinator {
        // c is the coordinator HashMap
        for k in c.keys() {
            let result = match k.as_str() {
                "EchoCoordinator" => echo_coordinator::configure(settings, components),
                "ChatCoordinator" => chat_coordinator::configure(settings, components),
                "MonitorCoordinator" => monitor::configure(settings, components),
                "AliceCoordinator" => alice::configure(settings, components),
                "UdpEchoCoordinator" => udp_echo_coordinator::configure(settings, components),
                _ => {
                    log::warn!("unhandled {:#?} coordintor configuration", k);
                    Ok(None)
                },
            };
            if let Err(e) = result {
                return Err(e);
            }
            if let Ok(Some(sender)) = result {
                active_coordinators.push(CoordinatorInfo::new(k.clone(), sender))
            }
        }
    }
    Ok(active_coordinators)
}
pub fn configure ( settings : & settings :: Settings , components : & [ ComponentInfo ] ) -> Result < Vec < CoordinatorInfo > , ComponentError > { let mut active_coordinators : Vec < CoordinatorInfo > = Vec :: new ( ) ; for c in & settings . coordinator { // c is the coordinator HashMap for k in c . keys ( ) { let result = match k . as_str ( ) { " " => echo_coordinator :: configure ( settings , components ) , " " => chat_coordinator :: configure ( settings , components ) , " " => monitor :: configure ( settings , components ) , " " => alice :: configure ( settings , components ) , " " => udp_echo_coordinator :: configure ( settings , components ) , _ => { log :: warn ! ( " " k ) ; Ok ( None ) } , } ; if let Err ( e ) = result { return Err ( e ) ; } if let Ok ( Some ( sender ) ) = result { active_coordinators . push ( CoordinatorInfo :: new ( k . clone ( ) , sender ) ) } } } Ok ( active_coordinators ) }
coordinators (I dislike the name) assemble components to form a service.
coordinators ( I dislike the name ) assemble components to form a service .
settings
&settings::Settings
components
&[ComponentInfo]