| 39 | /// retried in-place. |
| 40 | #[derive(Debug)] |
| 41 | pub 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 | |
| 54 | impl<EngineClient_: EngineClient> Engine<EngineClient_> { |
| 55 | /// Creates a new [`Engine`] with an empty task queue and the passed initial [`EngineState`]. |
no outgoing calls
no test coverage detected