Skip to content

Commit

Permalink
Document SchedulingStateMachine::schedule_task()
Browse files Browse the repository at this point in the history
  • Loading branch information
ryoqun committed Feb 28, 2024
1 parent 5887a91 commit be1bc6c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions unified-scheduler-logic/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,13 @@ impl SchedulingStateMachine {
self.total_task_count.current()
}

/// Schedules given `task`, returning it if successful.
///
/// Returns `Some(task)` if it's immediately scheduled. Otherwise, returns `None`,
/// indicating the task is blocked currently.
///
/// Note that this function's type signature is intentionally redundant to take the ownership
/// of given task _conditionally_ for future optimization.
#[must_use]
pub fn schedule_task(&mut self, task: Task) -> Option<Task> {
let new_task_index = task.task_index();
Expand Down

0 comments on commit be1bc6c

Please sign in to comment.