In-memory pub/sub topic management (imperative shell).
Implements IPubSubManager protocol using atom-based subscription storage. Coordinates between pure pub/sub core functions and stateful subscription management.
Single-server implementation - subscriptions stored in memory. For multi-server deployments, would need Redis-backed implementation (v0.2.0).
Thread-safe via atom swap operations.
In-memory pub/sub topic management (imperative shell). Implements IPubSubManager protocol using atom-based subscription storage. Coordinates between pure pub/sub core functions and stateful subscription management. Single-server implementation - subscriptions stored in memory. For multi-server deployments, would need Redis-backed implementation (v0.2.0). Thread-safe via atom swap operations.
(create-pubsub-manager)Create new in-memory pub/sub manager.
Uses atom for thread-safe subscription storage. All state changes go through pure core functions via atom swap.
Returns: AtomPubSubManager record implementing IPubSubManager
Example: (def pubsub-mgr (create-pubsub-manager)) (ports/subscribe-to-topic pubsub-mgr conn-id "order:123")
Create new in-memory pub/sub manager. Uses atom for thread-safe subscription storage. All state changes go through pure core functions via atom swap. Returns: AtomPubSubManager record implementing IPubSubManager Example: (def pubsub-mgr (create-pubsub-manager)) (ports/subscribe-to-topic pubsub-mgr conn-id "order:123")
(create-pubsub-manager-with-state initial-subscriptions)Create pub/sub manager with initial state.
Useful for testing or restoring from snapshot.
Args: initial-subscriptions - Map of topic to set of connection IDs
Returns: AtomPubSubManager with initial state
Example: (def pubsub-mgr (create-pubsub-manager-with-state {"order:123" #{#uuid "111..." #uuid "222..."}}))
Create pub/sub manager with initial state.
Useful for testing or restoring from snapshot.
Args:
initial-subscriptions - Map of topic to set of connection IDs
Returns:
AtomPubSubManager with initial state
Example:
(def pubsub-mgr
(create-pubsub-manager-with-state
{"order:123" #{#uuid "111..." #uuid "222..."}}))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 |