(add-handler conn handler matches)(add-handler {:keys [handlers handler-ids]}
handler
err-handler
{:keys [op args]})Registers handler to be called on conn whenever an incoming frame matches op and args. As part of args, subjects work as patterns as defined by NATS subject hierarchy wildcards. Takes in an optional error-handler in case of uncaught exceptions in the handler. The handler will be passed in the frame and conn, the err-handler the exception as well. NOTE: Uncaught exceptions in the error-handler will be swallowed. Returns a handler id, usable with remove-handler.
Registers handler to be called on conn whenever an incoming frame matches op and args. As part of args, subjects work as patterns as defined by NATS subject hierarchy wildcards. Takes in an optional error-handler in case of uncaught exceptions in the handler. The handler will be passed in the frame and conn, the err-handler the exception as well. NOTE: Uncaught exceptions in the error-handler will be swallowed. Returns a handler id, usable with remove-handler.
(close {:keys [socket executor]})Closes conn by cleaning up all underlying resources.
Closes conn by cleaning up all underlying resources.
(connect)(connect opts)Connects to a NATS server and performs the INFO/CONNECT handshake, upgrading to TLS if required. opts are merged over claxon.conf/defaults. Credentials found in the URLs are preferred over the ones supplied as fn opts. Returns a conn map to be passed to other functions.
Connects to a NATS server and performs the INFO/CONNECT handshake, upgrading to TLS if required. opts are merged over claxon.conf/defaults. Credentials found in the URLs are preferred over the ones supplied as fn opts. Returns a conn map to be passed to other functions.
(invoke conn {:keys [op args payloads]})Sends a frame ({:op ... :args ... :payloads ...}) to the server over conn. op: the operation, eg PUB, SUB, PING etc as a string args: the map of args, eg {:subject foo :sid 10} payloads: the map of (generally bytes payloads), eg for PUB
Sends a frame ({:op ... :args ... :payloads ...}) to the server over conn.
op: the operation, eg PUB, SUB, PING etc as a string
args: the map of args, eg {:subject foo :sid 10}
payloads: the map of (generally bytes payloads), eg for PUB(remove-handler {:keys [handlers]} id)Unregisters the handler in a conn by id.
Unregisters the handler in a conn by id.
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 |