pub struct Deferrer(/* private fields */);Expand description
Defer queue which can be accessed without a Core ref
Deferrer provides a way to defer calls from contexts which
don’t have access to a Core reference. The most obvious of
these is a Drop handler. So when a Drop handler needs to
queue cleanup actions, keep a Deferrer instance in the
structure and then those operations can be deferred without
problem. (The size of a Deferrer instance is 0 bytes for the
global or thread-local implementations, or a usize for inline.)
Obtain a Deferrer instance using Core::deferrer. To use
it, call the Deferrer::defer method with a closure which
performs the operation required. Note that all Actor
instances have a Deferrer built in which can be used from
outside the actor as Actor::defer.
Note that in final shutdown of a Stakker system, deferring an
action after the main loop has stopped running the Stakker
queues or after the Stakker instance has been dropped will be
accepted but the call will never execute. So make sure that all
actors are terminated before the last run of the Stakker
queues if you need cleanup actions to complete.