/// Enqueue specific stashed tasks.
/// They will be normally handled afterwards.
Enqueue specific stashed tasks.
They will be normally handled afterwards.
Enqueue specific stashed tasks . They will be normally handled afterwards .
fn enqueue(message: EnqueueMessage, state: &SharedState) -> Message {
    let (matching, mismatching) = {
        let mut state = state.lock().unwrap();
        let (matching, mismatching) = state.tasks_in_statuses(
            Some(message.task_ids),
            vec![TaskStatus::Stashed, TaskStatus::Locked],
        );
        for task_id in &matching {
            state.change_status(*task_id, TaskStatus::Queued);
        }
        (matching, mismatching)
    };
    let message = "Tasks are enqueued";
    let response = compile_task_response(message, matching, mismatching);
    return create_success_message(response);
}
fn enqueue ( message : EnqueueMessage , state : & SharedState ) -> Message { let ( matching , mismatching ) = { let mut state = state . lock ( ) . unwrap ( ) ; let ( matching , mismatching ) = state . tasks_in_statuses ( Some ( message . task_ids ) , vec ! [ TaskStatus Stashed TaskStatus Locked ] , ) ; for task_id in & matching { state . change_status ( * task_id , TaskStatus :: Queued ) ; } ( matching , mismatching ) } ; let message = " " ; let response = compile_task_response ( message , matching , mismatching ) ; return create_success_message ( response ) ; }
Enqueue specific stashed tasks.
Enqueue specific stashed tasks .
message
EnqueueMessage
state
&SharedState