Docs/API Reference/Kernel

Kernel API: event bus

The event handler receives a SystemEvent envelope with type, payload, timestamp and source, not only the payload.

1 min read

Event envelope#

The event handler receives a SystemEvent envelope with type, payload, timestamp and source, not only the payload.

Methods#

  • subscribe(eventType, subscriberId, handler)
  • unsubscribe(eventType, subscriberId)
  • once(eventType, handler, subscriberIdPrefix?)
  • publish(eventType, payload, source?, options?)
  • publishStrict(eventType, payload, source?)
  • clearAll()

Use a stable subscriber ID when you need to unsubscribe later. The implementation inspected for this docs snapshot dispatches by exact event type; wildcard subscriptions should not be assumed.

Operational semantics#

This is an in-process event bus. It is useful for decoupling services within one running process, but it does not persist events or guarantee delivery across crashes, deployments or multiple instances. Use a durable broker or database outbox for business-critical asynchronous work.

veap
Preparing0%