Registration
Registration connects a message ID to its transport — a Subject for events and callback messages, a handler function for executors. Nothing can be fired or executed before it is registered: fire throws for unregistered IDs, exec throws for unregistered executors.
Since v3.5 the message-driven flow is the only way to register; the older service methods (record, recordWithPipe, recordExecutor, recordHandler) are deprecated and will be removed.
The Connect messages
Exact signatures: Infrastructure Messages and the API reference.
Prefer registrators in application code
Bare Connect* calls work but track nothing. A PostboyAbstractRegistrator records every registration and disconnects all of them in one down():
The registrator's chainable record* methods are not deprecated — they internally use the same Connect* messages. Subject flavors (recordSubject/recordReplay/recordBehavior) are covered in Events.
Rules and semantics
One route per ID. Registering an ID that is already registered overwrites the previous Subject/handler silently (console warning) — the old Subject is dropped without being completed, so its subscribers hang. Avoid double registration; group registrations in registrators.
Register first, subscribe after. Canonical order: define the class with its static ID → register (registrator
up()orConnect*) → subscribe → fire/exec.Unregister deliberately.
exec(new DisconnectMessage(SomeMessage.ID))completes the subject and drops any executor registered under the same ID; furtherfire/subof the type throws.
Deprecated service methods
Deprecated on | Replacement |
|---|---|
|
|
|
|
|
|
|
|
Next steps
Lifecycle Management — registrators and teardown.
How It Works — what the store does with a registration.
Caveats — the failure modes of ID reuse.