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 session_core_count() -> u32;
}

Required Methods§

source

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.

source

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.

source

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.

source

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.

source

fn session_core_count() -> u32

How many cores are allocated to this provider.

As the name suggests the core count has to be session buffered:

  • Core count has to be predetermined for the next session in the current session.
  • Core count must not change during a session.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T: Config> AssignmentProvider<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for polkadot_runtime_parachains::assigner_coretime::pallet::Pallet<T>

source§

impl<T: Config> AssignmentProvider<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for polkadot_runtime_parachains::assigner_parachains::pallet::Pallet<T>