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);
    }

    if let Some(group) = &message.group {
        create_success_message(format!("All tasks of Group {} is being killed.", group))
    } else if message.all {
        create_success_message("All tasks are being killed.")
    } else {
        create_success_message("All tasks of the default queue are being paused.")
    }
}
/// Invoked when calling `pueue kill`.
/// Forward the kill message to the task handler, which then kills the process.
Invoked when calling `pueue kill`.
Forward the kill message to the task handler, which then kills the process.
Invoked when calling ` pueue kill ` . Forward the kill message to the task handler which then kills the process .
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);
    }
    if let Some(group) = &message.group {
        create_success_message(format!("All tasks of Group {} is being killed.", group))
    } else if message.all {
        create_success_message("All tasks are being killed.")
    } else {
        create_success_message("All tasks of the default queue are being paused.")
    }
}
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 ) ; } 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 kill`.
Invoked when calling ` pueue kill ` .
message
KillMessage
sender
&Sender<Message>
state
&SharedState