BSB Node.js Type Definitions
    Preparing search index...

    Class ServiceClient<Service, TEventSchemas, ServiceT>

    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 Plugin
    extends 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;
    });
    }
    }

    Type Parameters

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    pluginName: string = "{UNSET SERVICE CLIENT PLUGIN NAME}"
    initBeforePlugins?: string[]
    initAfterPlugins?: string[]
    runBeforePlugins?: string[]
    runAfterPlugins?: string[]

    Methods