AbstractReadonlyappThe unique app id of the app that is running
ReadonlymodeThe mode the app is running in
ReadonlycwdThe current working directory of the app
ReadonlypackageThe current working directory of the plugin
ReadonlypluginThe current working directory of the service
ReadonlypluginThe name of the plugin This is also the mapped name, or the name defined in the config rather than it's original defined name
Optional ReadonlyregionThe deployment region for resource context
ReadonlyconfigThe config of the plugin
Run lifecycle method for events plugins.
This method is inherited from the base plugin class but is not used by events plugins. Events plugins are initialized during the init phase and begin processing events immediately. They do not require a separate run phase.
void
Events plugins establish their event bus connections and listeners during initialization. The event routing is active as soon as init completes. Therefore, this method intentionally performs no operation.
// Events plugins do not need to implement run()
// The base class provides this no-op implementation
export class MyEventsPlugin extends BSBEvents<MyConfig> {
// No run() override needed
}
AbstractonListens for events that are emitted by other plugins Broadcast events are emitted and received by all plugins
The trace object for tracking the operation
The name of the plugin that is being listened to
The event to listen for
The function to call when the event is received
Promise that resolves when the event listener has been registered
AbstractemitEmits an event that is received by all plugins
The trace object for tracking the operation
The name of the plugin that is emitting the event
The event to emit
The arguments to pass to the event listener
Promise that resolves when the event has been emitted
AbstractonListens for events that are emitted by other plugins Events are emitted and received by a single plugin
The trace object for tracking the operation
The name of the plugin that is being listened to
The event to listen for
The function to call when the event is received
Promise that resolves when the event listener has been registered
AbstractemitEmits an event that is received by a single plugin
The trace object for tracking the operation
The name of the plugin that is emitting the event
The event to emit
The arguments to pass to the event listener
Promise that resolves when the event has been emitted
AbstractonListens for events that are emitted by other plugins and return a value Events are emitted and received by a single plugin
The trace object for tracking the operation
The name of the plugin that is being listened to
The event to listen for
The function to call when the event is received
Promise that resolves when the event listener has been registered
AbstractemitEmits an event that is received by a single plugin and returns a value
The trace object for tracking the operation
The name of the plugin that is emitting the event
The event to emit
The number of seconds to wait for the value to be returned
The arguments to pass to the event listener
Promise that resolves when the event has been emitted and the value has been returned
AbstractreceiveSets up a receive stream to receive a stream from another plugin
The trace object for tracking the operation
The name of the plugin that is emitting the event
The event to listen for
The function to call when the stream is received
OptionaltimeoutSeconds: numberThe number of seconds to wait for the stream to be received
Promise that resolves with the stream id that can be used to stream data to the listener
AbstractsendSets up a send stream to send a stream to another plugin that created a receive stream
The trace object for tracking the operation
The name of the plugin that is emitting the event
The event to listen for
The id of the stream to send data to
The stream to send data from
Promise that resolves when the stream has been sent
Optional AbstractdisposeDispose Optional function to be called when the plugin is being disposed
Optional AbstractinitInit Optional function to be called when the plugin is being initialized Can be sync or async
Observable context with logging, metrics, and trace information
v9 BREAKING CHANGE: Now requires Observable instead of DTrace. Observable provides unified access to logging, metrics, and tracing with automatic context propagation.
See
API: BSBEvents