MCPcopy Create free account
hub / github.com/Botloader/botloader / return_idle

Method return_idle

components/scheduler/src/vm_session.rs:391–397  ·  view source on GitHub ↗

Returns the worker to the pool with the vm still alive; the session state stays on the handle so the vm can be resumed on a later claim.

(self, pool: &VmWorkerPool)

Source from the content-addressed store, hash-verified

389 /// Returns the worker to the pool with the vm still alive; the session
390 /// state stays on the handle so the vm can be resumed on a later claim.
391 pub fn return_idle(self, pool: &VmWorkerPool) {
392 debug_assert!(
393 matches!(&self.worker.session_state, Some(s) if s.guild_id == self.guild_id),
394 "idle return without session state on the handle"
395 );
396 pool.return_worker(self.worker, false);
397 }
398
399 /// Returns the worker to the pool after its vm shut down, clearing the
400 /// session state so a later claim doesn't try to resume a dead vm.

Callers 1

handle_session_eventsMethod · 0.80

Calls 1

return_workerMethod · 0.80

Tested by

no test coverage detected