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

Method insert

crates/utilities/runtime/src/deterministic/executor.rs:116–125  ·  view source on GitHub ↗

Insert a new task into the running map and push it onto the ready queue.

(&self, future: Pin<Box<dyn Future<Output = ()> + Send>>)

Source from the content-addressed store, hash-verified

114impl Tasks {
115 /// Insert a new task into the running map and push it onto the ready queue.
116 pub fn insert(&self, future: Pin<Box<dyn Future<Output = ()> + Send>>) {
117 let id = {
118 let mut c = self.counter.lock().unwrap();
119 let id = *c;
120 *c += 1;
121 id
122 };
123 self.running.lock().unwrap().insert(id, Arc::new(Task { future: Mutex::new(future) }));
124 self.queue(id);
125 }
126
127 /// Push a task ID onto the ready queue (called by `TaskWaker`).
128 pub fn queue(&self, id: u128) {

Callers 7

newMethod · 0.45
build_test_genesis_azulFunction · 0.45
startMethod · 0.45
spawnMethod · 0.45
return_reserved_nonceMethod · 0.45
rollbackMethod · 0.45

Calls 2

lockMethod · 0.80
queueMethod · 0.80

Tested by

no test coverage detected