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.

on

Methods

bind(EventBindingCallback callback) → void Function()

Available on StatefulPluginService<PluginContext>, provided by the StatefulPluginServiceHelper extension

Bind a type-agnostic observer to the session's event bus.
emit<T>(T event, {String? identifier}) Future<EventEnvelope<T>>

Available on StatefulPluginService<PluginContext>, provided by the StatefulPluginServiceHelper extension

Emit an event into the session's event bus and await all handlers.
maybeResolve<T extends Object>(ServiceId serviceId) → T?

Available on StatefulPluginService<PluginContext>, provided by the StatefulPluginServiceHelper extension

Resolve a service by its serviceId, returning null if not found.
on<E>(EventHandler<E> handler, {int priority = Priority.normal, String? identifier}) EventSubscription

Available on StatefulPluginService<PluginContext>, provided by the StatefulPluginServiceHelper extension

Subscribe to events of type E.
onRequest<Request, Response>(RequestHandler<Request, Response> handler, {int priority = Priority.normal, String? identifier}) EventSubscription

Available on StatefulPluginService<PluginContext>, provided by the StatefulPluginServiceHelper extension

Register a request handler for a request/response type pair. Auto-tracked and cancelled when the framework unbinds the service.
onRequestSync<Request, Response>(SyncRequestHandler<Request, Response> handler, {int priority = Priority.normal, String? identifier}) EventSubscription

Available on StatefulPluginService<PluginContext>, provided by the StatefulPluginServiceHelper extension

Register a synchronous request handler. Auto-tracked and cancelled when the framework unbinds the service.
resolve<T>(ServiceId serviceId) → T

Available on StatefulPluginService<PluginContext>, provided by the StatefulPluginServiceHelper extension

Resolve a service by its serviceId.
resolveAfter<T>({required PluginId pluginId, required ServiceId serviceId}) → T

Available on StatefulPluginService<PluginContext>, provided by the StatefulPluginServiceHelper extension

Resolve the next service in the priority chain after pluginId.