pub trait AssignmentProvider<BlockNumber> {
// Required methods
fn pop_assignment_for_core(core_idx: CoreIndex) -> Option<Assignment>;
fn report_processed(assignment: Assignment);
fn push_back_assignment(assignment: Assignment);
fn get_mock_assignment(core_idx: CoreIndex, para_id: ParaId) -> Assignment;
fn assignment_duplicated(assignment: &Assignment);
}
Required Methods§
sourcefn pop_assignment_for_core(core_idx: CoreIndex) -> Option<Assignment>
fn pop_assignment_for_core(core_idx: CoreIndex) -> Option<Assignment>
Pops an Assignment
from the provider for a specified [CoreIndex
].
This is where assignments come into existence.
sourcefn report_processed(assignment: Assignment)
fn report_processed(assignment: Assignment)
A previously popped Assignment
has been fully processed.
Report back to the assignment provider that an assignment is done and no longer present in the scheduler.
This is one way of the life of an assignment coming to an end.
sourcefn push_back_assignment(assignment: Assignment)
fn push_back_assignment(assignment: Assignment)
Push back a previously popped assignment.
If the assignment could not be processed within the current session, it can be pushed back to the assignment provider in order to be popped again later.
This is the second way the life of an assignment can come to an end.
sourcefn get_mock_assignment(core_idx: CoreIndex, para_id: ParaId) -> Assignment
fn get_mock_assignment(core_idx: CoreIndex, para_id: ParaId) -> Assignment
Push some assignment for mocking/benchmarks purposes.
Useful for benchmarks and testing. The returned assignment is “valid” and can if need be
passed into report_processed
for example.
sourcefn assignment_duplicated(assignment: &Assignment)
fn assignment_duplicated(assignment: &Assignment)
Report that an assignment was duplicated by the scheduler.