Trait gear_common::scheduler::Scheduler
source · pub trait Scheduler {
type BlockNumber;
type Task;
type Cost;
type Error: TaskPoolError;
type OutputError: From<Self::Error> + Debug;
type CostsPerBlock: SchedulingCostsPerBlock<BlockNumber = Self::BlockNumber, Cost = Self::Cost>;
type FirstIncompleteTasksBlock: ValueStorage<Value = Self::BlockNumber>;
type TaskPool: TaskPool<BlockNumber = Self::BlockNumber, Task = Self::Task, Error = Self::Error, OutputError = Self::OutputError> + CountedByKey<Key = Self::BlockNumber, Length = usize> + KeyIterableByKeyMap<Key1 = Self::BlockNumber, Key2 = Self::Task>;
// Provided method
fn reset() { ... }
}
Expand description
Represents scheduler’s logic of centralized delayed tasks management logic.
Required Associated Types§
sourcetype BlockNumber
type BlockNumber
Block number type of the messenger.
sourcetype Error: TaskPoolError
type Error: TaskPoolError
Inner error type generated by gear’s storage types.
sourcetype OutputError: From<Self::Error> + Debug
type OutputError: From<Self::Error> + Debug
Output error of each storage algorithm.
Implements From<Self::Error>
to be able to return
any required error type.
sourcetype CostsPerBlock: SchedulingCostsPerBlock<BlockNumber = Self::BlockNumber, Cost = Self::Cost>
type CostsPerBlock: SchedulingCostsPerBlock<BlockNumber = Self::BlockNumber, Cost = Self::Cost>
Storing costs per block.
sourcetype FirstIncompleteTasksBlock: ValueStorage<Value = Self::BlockNumber>
type FirstIncompleteTasksBlock: ValueStorage<Value = Self::BlockNumber>
The first block of incomplete tasks, which have already passed, but still contain tasks to deal with.
Used for checking if scheduler is able to process current block aimed tasks, or there are some incomplete job from previous blocks.
sourcetype TaskPool: TaskPool<BlockNumber = Self::BlockNumber, Task = Self::Task, Error = Self::Error, OutputError = Self::OutputError> + CountedByKey<Key = Self::BlockNumber, Length = usize> + KeyIterableByKeyMap<Key1 = Self::BlockNumber, Key2 = Self::Task>
type TaskPool: TaskPool<BlockNumber = Self::BlockNumber, Task = Self::Task, Error = Self::Error, OutputError = Self::OutputError> + CountedByKey<Key = Self::BlockNumber, Length = usize> + KeyIterableByKeyMap<Key1 = Self::BlockNumber, Key2 = Self::Task>
Gear task pool.
Task pool contains tasks with block number when they should be done.
Provided Methods§
Object Safety§
This trait is not object safe.