pub fn new(
        context_lifecycle: Box<ContextLifecycle>,
        state_id: String,
    ) -> Result<SerialScheduler, SchedulerError> {
        let (execution_tx, execution_rx) = mpsc::channel();
        let (core_tx, core_rx) = mpsc::channel();

        let shared_lock = Arc::new(Mutex::new(shared::Shared::new()));

        // Start the thread to accept and process CoreMessage messages
        let core_handle = core::SchedulerCore::new(
            shared_lock.clone(),
            core_rx,
            execution_tx,
            context_lifecycle,
            state_id,
        )
        .start()?;

        Ok(SerialScheduler {
            shared_lock,
            core_handle: Some(core_handle),
            core_tx: core_tx.clone(),
            task_iterator: Some(Box::new(execution::SerialExecutionTaskIterator::new(
                core_tx,
                execution_rx,
            ))),
        })
    }
/// Returns a newly created `SerialScheduler`.
Returns a newly created `SerialScheduler`.
Returns a newly created ` SerialScheduler ` .
pub fn new(
        context_lifecycle: Box<ContextLifecycle>,
        state_id: String,
    ) -> Result<SerialScheduler, SchedulerError> {
        let (execution_tx, execution_rx) = mpsc::channel();
        let (core_tx, core_rx) = mpsc::channel();
        let shared_lock = Arc::new(Mutex::new(shared::Shared::new()));
        // Start the thread to accept and process CoreMessage messages
        let core_handle = core::SchedulerCore::new(
            shared_lock.clone(),
            core_rx,
            execution_tx,
            context_lifecycle,
            state_id,
        )
        .start()?;
        Ok(SerialScheduler {
            shared_lock,
            core_handle: Some(core_handle),
            core_tx: core_tx.clone(),
            task_iterator: Some(Box::new(execution::SerialExecutionTaskIterator::new(
                core_tx,
                execution_rx,
            ))),
        })
    }
pub fn new ( context_lifecycle : Box < ContextLifecycle > , state_id : String , ) -> Result < SerialScheduler , SchedulerError > { let ( execution_tx , execution_rx ) = mpsc :: channel ( ) ; let ( core_tx , core_rx ) = mpsc :: channel ( ) ; let shared_lock = Arc :: new ( Mutex :: new ( shared :: Shared :: new ( ) ) ) ; // Start the thread to accept and process CoreMessage messages let core_handle = core :: SchedulerCore :: new ( shared_lock . clone ( ) , core_rx , execution_tx , context_lifecycle , state_id , ) . start ( ) ? ; Ok ( SerialScheduler { shared_lock , core_handle : Some ( core_handle ) , core_tx : core_tx . clone ( ) , task_iterator : Some ( Box :: new ( execution :: SerialExecutionTaskIterator :: new ( core_tx , execution_rx , ) ) ) , } ) }
Returns a newly created `SerialScheduler`.
Returns a newly created ` SerialScheduler ` .
context_lifecycle
Box<ContextLifecycle>
state_id
String
context_lifecycle
Box<ContextLifecycle>
state_id
String