trigger #
Available since 2.8.0
Triggers an event.
If an internal event is triggered, the payload must be the same as the one usually expected.
This method can only be used once the application is started.
trigger<TEventDefinition extends EventDefinition = EventDefinition>(
event: TEventDefinition["name"],
...payload: TEventDefinition["args"]
): Promise<TEventDefinition["args"][0]>Returns #
Returns a Promise resolving to the pipe chain result.
Errors #
- plugin.runtime.unavailable_before_start: the application is not started yet
Usage #
await app.trigger('prometheus:start-metrics')