MCPcopy Create free account
hub / github.com/base/base / Engine

Class Engine

crates/consensus/engine/src/task_queue/core.rs:41–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39/// retried in-place.
40#[derive(Debug)]
41pub struct Engine<EngineClient_: EngineClient> {
42 /// The state of the engine.
43 state: EngineState,
44 /// A sender that can be used to notify the engine actor of state changes.
45 state_sender: Sender<EngineState>,
46 /// A sender that can be used to notify the engine actor of task queue length changes.
47 task_queue_length: Sender<usize>,
48 /// The task queue.
49 tasks: BinaryHeap<(EngineTask<EngineClient_>, Reverse<u64>)>,
50 /// Monotonic sequence number used to preserve FIFO order within equal-priority tasks.
51 next_task_sequence: u64,
52}
53
54impl<EngineClient_: EngineClient> Engine<EngineClient_> {
55 /// Creates a new [`Engine`] with an empty task queue and the passed initial [`EngineState`].

Calls

no outgoing calls

Tested by

no test coverage detected