fn start(message: StartMessage, sender: &Sender<Message>, state: &SharedState) -> Message {
    // Check whether a given group exists
    if let Some(group) = &message.group {
        let state = state.lock().unwrap();
        if !state.groups.contains_key(group) {
            return create_failure_message(format!("Group {} doesn't exists", group));
        }
    }

    sender
        .send(Message::Start(message.clone()))
        .expect(SENDER_ERR);
    if !message.task_ids.is_empty() {
        let response = task_response_helper(
            "Tasks are being started",
            message.task_ids,
            vec![TaskStatus::Paused, TaskStatus::Queued, TaskStatus::Stashed],
            state,
        );
        return create_success_message(response);
    }

    if let Some(group) = &message.group {
        create_success_message(format!("Group {} is being resumed.", group))
    } else if message.all {
        create_success_message("All queues are being resumed.")
    } else {
        create_success_message("Default queue is being resumed.")
    }
}
/// Invoked when calling `pueue start`.
/// Forward the start message to the task handler, which then starts the process(es).
Invoked when calling `pueue start`.
Forward the start message to the task handler, which then starts the process(es).
Invoked when calling ` pueue start ` . Forward the start message to the task handler which then starts the process ( es ) .
fn start(message: StartMessage, sender: &Sender<Message>, state: &SharedState) -> Message {
    // Check whether a given group exists
    if let Some(group) = &message.group {
        let state = state.lock().unwrap();
        if !state.groups.contains_key(group) {
            return create_failure_message(format!("Group {} doesn't exists", group));
        }
    }
    sender
        .send(Message::Start(message.clone()))
        .expect(SENDER_ERR);
    if !message.task_ids.is_empty() {
        let response = task_response_helper(
            "Tasks are being started",
            message.task_ids,
            vec![TaskStatus::Paused, TaskStatus::Queued, TaskStatus::Stashed],
            state,
        );
        return create_success_message(response);
    }
    if let Some(group) = &message.group {
        create_success_message(format!("Group {} is being resumed.", group))
    } else if message.all {
        create_success_message("All queues are being resumed.")
    } else {
        create_success_message("Default queue is being resumed.")
    }
}
fn start ( message : StartMessage , sender : & Sender < Message > , state : & SharedState ) -> Message { // Check whether a given group exists if let Some ( group ) = & message . group { let state = state . lock ( ) . unwrap ( ) ; if ! state . groups . contains_key ( group ) { return create_failure_message ( format ! ( " " group ) ) ; } } sender . send ( Message :: Start ( message . clone ( ) ) ) . expect ( SENDER_ERR ) ; if ! message . task_ids . is_empty ( ) { let response = task_response_helper ( " " , message . task_ids , vec ! [ TaskStatus Paused TaskStatus Queued TaskStatus Stashed ] , state , ) ; return create_success_message ( response ) ; } if let Some ( group ) = & message . group { create_success_message ( format ! ( " " group ) ) } else if message . all { create_success_message ( " " ) } else { create_success_message ( " " ) } }
Invoked when calling `pueue start`.
Invoked when calling ` pueue start ` .
message
StartMessage
sender
&Sender<Message>
state
&SharedState