Observability instrumentation using a global 'tap' which can have events
reported to it from any location in the code. This draws inspiration from
Clojure's tap>
, but is more directly targeted at instrumentation.
Observability instrumentation using a global 'tap' which can have events reported to it from any location in the code. This draws inspiration from Clojure's `tap>`, but is more directly targeted at instrumentation.
(clear!)
Remove all subscriptions from the tap.
Remove all subscriptions from the tap.
(drain!)
Drain the current event-queue to empty it. Mostly useful for testing.
Drain the current event-queue to empty it. Mostly useful for testing.
(queue-size)
Return the number of events currently in the queue.
Return the number of events currently in the queue.
(send event)
(send event timeout-ms)
Send the given event to be published to any subscribed tap functions. Returns true if the event was accepted or false if it was dropped.
By default this returns immediately. If a timeout is given, this will block until the event is accepted or the timeout expires.
Send the given event to be published to any subscribed tap functions. Returns true if the event was accepted or false if it was dropped. By default this returns immediately. If a timeout is given, this will block until the event is accepted or the timeout expires.
(subscribe! k f)
Subscribe a function to be called with all events sent to the tap. Returns
the key k
.
The key uniquely identifies the function and will replace any existing
subscription; it may also be used to remove it later with unsubscribe!
.
Subscribe a function to be called with all events sent to the tap. Returns the key `k`. The key uniquely identifies the function and will replace any existing subscription; it may also be used to remove it later with `unsubscribe!`.
(unsubscribe! k)
Remove the identified function from the tap subscriptions.
Remove the identified function from the tap subscriptions.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close