Messages and Executors Reference
Reference page for the data carriers of @artstesh/postboy (applies to v3.5.x). For the conceptual model see Message roles.
Every message and executor class must declare its own static readonly ID — a class without one throws <ClassName> should have a static ID field on first use, and a subclass that merely inherits its parent's ID silently shares its route.
PostboyMessage
The base of everything that travels through the bus.
Member | Description |
|---|---|
| Free-form envelope: |
| The static |
| Merges into |
PostboyGenericMessage
Base for pub/sub events, dispatched with fire and consumed via sub/once. Payload lives in the concrete class's own constructor fields. See Events.
PostboyCallbackMessage<T>
Async request/response carrier for fireCallback. The responder subscribes to the message type and calls next/finish on the received instance; the requester consumes the observable. Calling finish completes the result stream — one message instance answers once. See Callbacks.
PostboyExecutor<T>
Base for synchronous commands invoked via exec. T is the handler's return type (a phantom parameter — it exists for the type system only). See Executors.
PostboyExecutionHandler<R, E>
The class-based counterpart of an executor lambda. Register with ConnectHandler or a registrator's recordHandler — both are documented in the Infrastructure Messages Reference and the Registrators and Namespaces Reference.
MessageType<T>
The constructor type accepted by sub, once, registrations, and the testing toolkit — always pass the class itself (PingMessage, not new PingMessage()).
PostboyMessageMetadata / PostboyMessageContext
PostboyMessageMetadata is the writable envelope on every message. PostboyMessageContext is the reserved correlation-tracking shape (kept for future/tooling use — the bus itself does not populate it).
PostboySubscription
PostboySubscription — the registration record the store keeps for each message ID — is exported from the package root and documented on the PostboyService Reference.
Not exported from the package root
checkId (the internal static-ID guard), PostboyContextService, PostboyDependencyResolver, IdGenerator — internal machinery; do not import or emulate it.