pub struct ExecutorController { /* private fields */ }Expand description
Controls background handler dispatch tasks started by Photon::start_executor.
Implementations§
Source§impl ExecutorController
impl ExecutorController
Sourcepub fn start(
&self,
photon: &Photon,
identity: &Arc<dyn IdentityFactory>,
) -> Result<()>
pub fn start( &self, photon: &Photon, identity: &Arc<dyn IdentityFactory>, ) -> Result<()>
Spawn subscription loops for every inventory-registered handler.
§Panics
Panics if an internal lock is poisoned.
§Errors
Returns an error if the executor was already started on this controller.
§Contract
- Start is one-shot per controller; restart requires a new
Photonbuild. - Outer loops respect
Self::shutdown; in-flight handler tasks are awaited inSelf::join.
Sourcepub fn shutdown(&self)
pub fn shutdown(&self)
Signal all handler loops to stop accepting new events.
§Contract
- Idempotent: repeated calls are no-ops.
- Does not wait for in-flight handlers; call
Self::joinafterward.
Sourcepub async fn join(&self)
pub async fn join(&self)
Await outer subscription loops (and their in-flight handler tasks).
§Contract
- Call
Self::shutdownfirst for prompt exit from stream loops. - Drains stored outer
JoinHandles; each loop drains its own in-flightJoinSetbefore exiting. - Safe to call when no tasks were started (no-op).
§Panics
Panics if an internal lock is poisoned.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ExecutorController
impl RefUnwindSafe for ExecutorController
impl Send for ExecutorController
impl Sync for ExecutorController
impl Unpin for ExecutorController
impl UnsafeUnpin for ExecutorController
impl UnwindSafe for ExecutorController
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more