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