Platform abstraction seam for hive-weave.
JVM subsystems keep their java.util.concurrent impls verbatim; this namespace supplies the cross-platform clock plus the ClojureScript async building blocks (a core.async counting semaphore and a timeout race) used by the :cljs branches of the subsystems.
Platform abstraction seam for hive-weave. JVM subsystems keep their java.util.concurrent impls verbatim; this namespace supplies the cross-platform clock plus the ClojureScript async building blocks (a core.async counting semaphore and a timeout race) used by the :cljs branches of the subsystems.
(await-chan src timeout-ms)Race src against a timeout. Chan yields [:value v] when src produces v, or [:timeout] after timeout-ms.
Race src against a timeout. Chan yields [:value v] when src produces v, or [:timeout] after timeout-ms.
(ex-class-name e)Printable class/type name of a caught error.
Printable class/type name of a caught error.
(make-semaphore permits)Async counting semaphore. 1 permit = 1 caller-chosen unit.
Async counting semaphore. 1 permit = 1 caller-chosen unit.
(mono-ns)Monotonic nanoseconds for measuring durations.
Monotonic nanoseconds for measuring durations.
(sem-acquire! sem cost timeout-ms)Chan yielding :acquired when cost permits are reserved, or :timeout
after timeout-ms.
Chan yielding :acquired when `cost` permits are reserved, or :timeout after timeout-ms.
(sem-available sem)Currently-available permit count.
Currently-available permit count.
(sem-queue-length sem)Number of async waiters parked on the semaphore (0 on sync paths).
Number of async waiters parked on the semaphore (0 on sync paths).
(sem-release! sem cost)Return cost permits and grant waiting acquirers in FIFO order.
Return `cost` permits and grant waiting acquirers in FIFO order.
(sem-try-acquire! sem cost)Non-blocking acquire of cost permits. Returns true when reserved
(caller MUST sem-release! the same cost), false when unavailable.
Non-blocking acquire of `cost` permits. Returns true when reserved (caller MUST sem-release! the same cost), false when unavailable.
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 |