Instantiates a link to a Service Plugin.
Create a new ServiceClient based on a plugin class/definition and then use the events from that plugin.
// Example Service Plugin (just an example, not a real plugin):import { Plugin as Service1 } from "./myplugin";export class Pluginextends BSBService<null, Events> { private service1: ServiceClient<Service1>; constructor(config: BSBServiceConstructor) { super(config); this.service1 = new ServiceClient(Service1, this); } public async init(trace: DTrace) { this.events.onReturnableEvent("calculate", trace, async (iTrace: DTrace, a: number, b: number) => { this.log.info(iTrace, "Calculating {a} * {b}", { a, b }); return a * b; }); }} Copy
// Example Service Plugin (just an example, not a real plugin):import { Plugin as Service1 } from "./myplugin";export class Pluginextends BSBService<null, Events> { private service1: ServiceClient<Service1>; constructor(config: BSBServiceConstructor) { super(config); this.service1 = new ServiceClient(Service1, this); } public async init(trace: DTrace) { this.events.onReturnableEvent("calculate", trace, async (iTrace: DTrace, a: number, b: number) => { this.log.info(iTrace, "Calculating {a} * {b}", { a, b }); return a * b; }); }}
Readonly
API: ServiceClient
Optional
Init (v9: Observable only)
Run (v9: Observable only)
Instantiates a link to a Service Plugin.
Create a new ServiceClient based on a plugin class/definition and then use the events from that plugin.
Example