Stone.js API
    Preparing search index...

    The light kernel event handler: routes an event by a key instead of a path.

    The small sibling of RouterEventHandler. Installed as stone.kernel.eventHandler by @KeyRouting(), it plugs onto any adapter that runs the kernel: it extracts a routing key from a configurable property of the incoming event and dispatches through the key-router to the matching handler (a bus event, a realtime gateway method, a CLI command...). It never imports the full Router, so bundlers tree-shake the heavy router away when only @KeyRouting() is used.

    Implements

    • IEventHandler<IncomingEvent>
    Index
    • Route an incoming event to its keyed handler.

      Parameters

      • event: IncomingEvent

        The incoming event.

      Returns Promise<unknown>

      The handler's result, or undefined when unmatched (unless strict).

      When strict and the key is missing or unmatched.