StatefulPluginServiceHelper extension
Convenience helpers for StatefulPluginService resolution and bus APIs.
Subscriptions/bindings registered via these helpers go into the service's
own activeSubscriptions / activeBindings lists. Each session calls
register separately and constructs its own service instance inline, so
per-context bucketing isn't required at the service level.
Methods
-
bind(
EventBindingCallback callback) → void Function() -
Available on StatefulPluginService<
Bind a type-agnostic observer to the session's event bus.PluginContext> , provided by the StatefulPluginServiceHelper extension -
emit<
T> (T event, {String? identifier}) → Future< EventEnvelope< T> > -
Available on StatefulPluginService<
Emit an event into the session's event bus and await all handlers.PluginContext> , provided by the StatefulPluginServiceHelper extension -
maybeResolve<
T extends Object> (ServiceId serviceId) → T? -
Available on StatefulPluginService<
Resolve a service by itsPluginContext> , provided by the StatefulPluginServiceHelper extensionserviceId, returningnullif not found. -
on<
E> (EventHandler< E> handler, {int priority = Priority.normal, String? identifier}) → EventSubscription -
Available on StatefulPluginService<
Subscribe to events of typePluginContext> , provided by the StatefulPluginServiceHelper extensionE. -
onRequest<
Request, Response> (RequestHandler< Request, Response> handler, {int priority = Priority.normal, String? identifier}) → EventSubscription -
Available on StatefulPluginService<
Register a request handler for a request/response type pair. Auto-tracked and cancelled when the framework unbinds the service.PluginContext> , provided by the StatefulPluginServiceHelper extension -
onRequestSync<
Request, Response> (SyncRequestHandler< Request, Response> handler, {int priority = Priority.normal, String? identifier}) → EventSubscription -
Available on StatefulPluginService<
Register a synchronous request handler. Auto-tracked and cancelled when the framework unbinds the service.PluginContext> , provided by the StatefulPluginServiceHelper extension -
resolve<
T> (ServiceId serviceId) → T -
Available on StatefulPluginService<
Resolve a service by itsPluginContext> , provided by the StatefulPluginServiceHelper extensionserviceId. -
resolveAfter<
T> ({required PluginId pluginId, required ServiceId serviceId}) → T -
Available on StatefulPluginService<
Resolve the next service in the priority chain afterPluginContext> , provided by the StatefulPluginServiceHelper extensionpluginId.