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

Method enqueue

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

Enqueues a new [`EngineTask`] for execution. Updates the queue length and notifies listeners of the change.

(&mut self, task: EngineTask<EngineClient_>)

Source from the content-addressed store, hash-verified

394 /// Enqueues a new [`EngineTask`] for execution.
395 /// Updates the queue length and notifies listeners of the change.
396 pub fn enqueue(&mut self, task: EngineTask<EngineClient_>) {
397 let sequence = self.next_task_sequence;
398 self.next_task_sequence =
399 self.next_task_sequence.checked_add(1).expect("engine task sequence overflow");
400 self.tasks.push((task, Reverse(sequence)));
401 self.task_queue_length.send_replace(self.tasks.len());
402 Metrics::engine_task_queue_depth().set(self.tasks.len() as f64);
403 }
404
405 /// Sequentially inserts payloads that authoritatively replace the current unsafe chain.
406 ///

Calls 3

pushMethod · 0.45
lenMethod · 0.45
setMethod · 0.45