Type Alias: ServiceEntrypoint
ServiceEntrypoint = (
module,handler,registerDestroy) =>unknown
A service entrypoint in the style of lakutata 2.x: a function the entrypoint calls once when it starts (initialized: the objects it gets may inject the entrypoint), which receives the service requests of a transport and passes them to the handler. A promise it returns is awaited, its rejection fails the entrypoint's startup (2.x did not await it). Prefer an adapter (socketIOServiceEntrypoint, jsonRPCServiceEntrypoint, electronIPCServiceEntrypoint) for new code.
Parameters
module
The module owning the entrypoint (the application).
handler
Runs a request: dispatches a ServiceContext to the action whose pattern matches its input.
registerDestroy
Registers a function run when the entrypoint stops.
Returns
unknown