MCPcopy Create free account
hub / github.com/It4innovations/hyperqueue / compute_job_info

Function compute_job_info

crates/hyperqueue/src/server/client/mod.rs:662–686  ·  view source on GitHub ↗
(
    state_ref: &StateRef,
    selector: &IdSelector,
    include_running_tasks: bool,
)

Source from the content-addressed store, hash-verified

660}
661
662fn compute_job_info(
663 state_ref: &StateRef,
664 selector: &IdSelector,
665 include_running_tasks: bool,
666) -> ToClientMessage {
667 let state = state_ref.get();
668
669 let jobs: Vec<_> = match selector {
670 IdSelector::All => state
671 .jobs()
672 .map(|j| j.make_job_info(include_running_tasks))
673 .collect(),
674 IdSelector::LastN(n) => state
675 .last_n_ids(*n)
676 .filter_map(|id| state.get_job(id))
677 .map(|j| j.make_job_info(include_running_tasks))
678 .collect(),
679 IdSelector::Specific(array) => array
680 .iter()
681 .filter_map(|id| state.get_job(JobId::new(id)))
682 .map(|j| j.make_job_info(include_running_tasks))
683 .collect(),
684 };
685 ToClientMessage::JobInfoResponse(JobInfoResponse { jobs })
686}
687
688async fn handle_job_cancel(
689 state_ref: &StateRef,

Callers 1

client_rpc_loopFunction · 0.85

Calls 7

JobInfoResponseClass · 0.85
make_job_infoMethod · 0.80
last_n_idsMethod · 0.80
get_jobMethod · 0.80
getMethod · 0.45
jobsMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected