@eggjs/service-worker-runtime
v4.1.0
Published
protocol-agnostic tegg service worker runtime: @Runner event dispatch, context event injection and background task wiring
Readme
@eggjs/service-worker-runtime
The protocol-independent event dispatcher used by
@eggjs/service-worker. Most applications should depend on
@eggjs/service-worker instead of this package directly.
This package provides:
ServiceWorkerRunner, which dispatches each event by itstype;ContextProtoLoadUnitHookandContextProtoProperty, which make the current event injectable in request-scoped objects;BackgroundTaskHelper, which drains request-scoped background work during context destruction.
ServiceWorkerRunner expects the standalone host's module set to provide the
canonical PUBLIC eggObjectFactory from @eggjs/dynamic-inject-runtime; this
package does not provide a second private factory.
Protocol adapters register an AbstractEventHandler implementation with
@EventHandlerProto('<type>') and provide any required inner objects or
lifecycle hooks through their tegg module.
