In-memory message bus (single-process / test).
Holds an atom vector of registered delivery-fns. publish invokes each
synchronously and sums their returned counts. This is the default bus for
single-node deployments and the vehicle for the 2-node cross-instance test
(two services sharing one bus instance via the :bus option).
In-memory message bus (single-process / test). Holds an atom vector of registered delivery-fns. `publish` invokes each synchronously and sums their returned counts. This is the default bus for single-node deployments and the vehicle for the 2-node cross-instance test (two services sharing one bus instance via the :bus option).
Redis-backed IMessageBus: routing envelopes travel as Nippy-frozen bytes over a binary Redis pub/sub channel. publish borrows a pooled connection; the subscriber owns ONE dedicated connection (not from the publish pool, so a blocking SUBSCRIBE never starves publishers) on a daemon thread.
Concurrency:
Trust boundary: onMessage thaws Nippy bytes off the channel. Envelopes are produced only by this framework's own publishers on a trusted Redis instance. Do NOT point this at a Redis shared with untrusted writers — Nippy thaw of attacker-controlled bytes is a deserialization risk.
Redis-backed IMessageBus: routing envelopes travel as Nippy-frozen bytes over a binary Redis pub/sub channel. publish borrows a pooled connection; the subscriber owns ONE dedicated connection (not from the publish pool, so a blocking SUBSCRIBE never starves publishers) on a daemon thread. Concurrency: - Singleton subscriber: start-subscriber! is idempotent (running? guard) so a node never holds two channel subscriptions (which would double-deliver). - Reconnect: the daemon loops with backoff, acquiring the connection INSIDE the loop so a Redis outage at startup retries instead of killing the daemon and leaving the node permanently deaf. Gap messages are missed (at-most-once, accepted). Trust boundary: onMessage thaws Nippy bytes off the channel. Envelopes are produced only by this framework's own publishers on a trusted Redis instance. Do NOT point this at a Redis shared with untrusted writers — Nippy thaw of attacker-controlled bytes is a deserialization risk.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |