fn pause(message: PauseMessage, sender: &Sender<Message>, state: &SharedState) -> Message {
    sender
        .send(Message::Pause(message.clone()))
        .expect(SENDER_ERR);
    if !message.task_ids.is_empty() {
        let response = task_response_helper(
            "Tasks are being paused",
            message.task_ids,
            vec![TaskStatus::Running],
            state,
        );
        return create_success_message(response);
    }

    return create_success_message("Daemon and all tasks are being paused.");
}
/// Forward the pause message to the task handler and respond to the client
Forward the pause message to the task handler and respond to the client
Forward the pause message to the task handler and respond to the client
fn pause(message: PauseMessage, sender: &Sender<Message>, state: &SharedState) -> Message {
    sender
        .send(Message::Pause(message.clone()))
        .expect(SENDER_ERR);
    if !message.task_ids.is_empty() {
        let response = task_response_helper(
            "Tasks are being paused",
            message.task_ids,
            vec![TaskStatus::Running],
            state,
        );
        return create_success_message(response);
    }
    return create_success_message("Daemon and all tasks are being paused.");
}
fn pause ( message : PauseMessage , sender : & Sender < Message > , state : & SharedState ) -> Message { sender . send ( Message :: Pause ( message . clone ( ) ) ) . expect ( SENDER_ERR ) ; if ! message . task_ids . is_empty ( ) { let response = task_response_helper ( " " , message . task_ids , vec ! [ TaskStatus Running ] , state , ) ; return create_success_message ( response ) ; } return create_success_message ( " " ) ; }
Forward the pause message to the task handler and respond to the client
Forward the pause message to the task handler and respond to the client
message
PauseMessage
sender
&Sender<Message>
state
&SharedState
message
PauseMessage
sender
&Sender<Message>
state
&SharedState