Liking cljdoc? Tell your friends :D

fx.async.protocols

Core protocols for fibers, queues, coordination, and async communication in fx.

Core protocols for fibers, queues, coordination, and async communication in fx.
raw docstring

deferred?clj/s

(deferred? x)

Returns true if x satisfies the IDeferred protocol.

Returns true if `x` satisfies the IDeferred protocol.
raw docstring

fiber-childrenclj/s

(fiber-children fiber)

fiber-idclj/s

(fiber-id fiber)

fiber-resultclj/s

(fiber-result fiber)

fiber-statusclj/s

(fiber-status fiber)

fiber-status-atomclj/s

(fiber-status-atom fiber)

fiber?clj/s

(fiber? x)

Returns true if x satisfies the IFiber protocol.

Returns true if `x` satisfies the IFiber protocol.
raw docstring

hub?clj/s

(hub? x)

Returns true if x satisfies the IHub protocol.

Returns true if `x` satisfies the IHub protocol.
raw docstring

IDeferredclj/sprotocol

Protocol for single-assignment async deferred values.

Protocol for single-assignment async deferred values.

-deferred-await!clj/s

(-deferred-await! this)
(-deferred-await! this timeout-ms timeout-val)

Awaits completion of the deferred, returning the value or throwing if failed/timed out.

Awaits completion of the deferred, returning the value or throwing if failed/timed out.

-deferred-completed?clj/s

(-deferred-completed? this)

Returns true if the deferred has already been completed.

Returns true if the deferred has already been completed.

-deferred-fail!clj/s

(-deferred-fail! this failure-or-err)

Completes the deferred with a failure or exception. Returns true if first to complete.

Completes the deferred with a failure or exception. Returns true if first to complete.

-deferred-succeed!clj/s

(-deferred-succeed! this val)

Completes the deferred successfully with val. Returns true if first to complete.

Completes the deferred successfully with `val`. Returns true if first to complete.
raw docstring

IFiberclj/sprotocol

Protocol representing a lightweight, structured fiber of computation.

Protocol representing a lightweight, structured fiber of computation.

-fiber-childrenclj/s

(-fiber-children this)

Returns an atom containing the set of active child fibers.

Returns an atom containing the set of active child fibers.

-fiber-idclj/s

(-fiber-id this)

Returns the unique identifier of the fiber.

Returns the unique identifier of the fiber.

-fiber-interrupt!clj/s

(-fiber-interrupt! this)
(-fiber-interrupt! this reason)

Interrupts the fiber and cascades cancellation across all active child fibers.

Interrupts the fiber and cascades cancellation across all active child fibers.

-fiber-resultclj/s

(-fiber-result this)

Returns a CompletableFuture or promise holding the eventual value or failure.

Returns a CompletableFuture or promise holding the eventual value or failure.

-fiber-statusclj/s

(-fiber-status this)

Returns the current lifecycle status keyword: :running, :succeeded, :failed, or :interrupted.

Returns the current lifecycle status keyword: :running, :succeeded, :failed, or :interrupted.

-fiber-status-atomclj/s

(-fiber-status-atom this)

Returns the internal atomic reference containing the fiber's status keyword.

Returns the internal atomic reference containing the fiber's status keyword.
raw docstring

IHubclj/sprotocol

Protocol for multi-producer multi-consumer broadcast Hubs.

Protocol for multi-producer multi-consumer broadcast Hubs.

-hub-publish!clj/s

(-hub-publish! this item)

Publishes an item to all active subscribers. Returns count of active recipients.

Publishes an item to all active subscribers. Returns count of active recipients.

-hub-shutdown!clj/s

(-hub-shutdown! this)

Closes the Hub and shuts down all active subscription queues.

Closes the Hub and shuts down all active subscription queues.

-hub-subscribe!clj/s

(-hub-subscribe! this)

Creates and returns a new subscription Queue for a subscriber.

Creates and returns a new subscription Queue for a subscriber.

-hub-subscriber-countclj/s

(-hub-subscriber-count this)

Returns the number of currently active subscriber queues.

Returns the number of currently active subscriber queues.

-hub-unsubscribe!clj/s

(-hub-unsubscribe! this sub-queue)

Unregisters a subscriber queue from receiving future broadcast messages.

Unregisters a subscriber queue from receiving future broadcast messages.
raw docstring

ILatchclj/sprotocol

Protocol for countdown synchronization latches.

Protocol for countdown synchronization latches.

-latch-await!clj/s

(-latch-await! this)
(-latch-await! this timeout-ms)

Awaits until the latch count reaches 0, or timeout expires. Returns boolean.

Awaits until the latch count reaches 0, or timeout expires. Returns boolean.

-latch-count-down!clj/s

(-latch-count-down! this)

Decrements the latch count, releasing all waiting callers when count reaches 0.

Decrements the latch count, releasing all waiting callers when count reaches 0.

-latch-get-countclj/s

(-latch-get-count this)

Returns the current remaining count.

Returns the current remaining count.
raw docstring

IQueueclj/sprotocol

Protocol for backpressure-aware, multi-producer multi-consumer async queues.

Protocol for backpressure-aware, multi-producer multi-consumer async queues.

-queue-capacityclj/s

(-queue-capacity this)

Returns the maximum capacity of the queue, or nil if unbounded.

Returns the maximum capacity of the queue, or nil if unbounded.

-queue-offer!clj/s

(-queue-offer! this item)

Offers an item to the queue. Returns true if accepted, false if capacity full and non-blocking.

Offers an item to the queue. Returns true if accepted, false if capacity full and non-blocking.

-queue-poll!clj/s

(-queue-poll! this)

Takes an item immediately without parking; returns nil if empty.

Takes an item immediately without parking; returns nil if empty.

-queue-shutdown!clj/s

(-queue-shutdown! this)

Closes the queue, preventing new offers and waking pending takes/offers.

Closes the queue, preventing new offers and waking pending takes/offers.

-queue-sizeclj/s

(-queue-size this)

Returns the current count of buffered elements in the queue.

Returns the current count of buffered elements in the queue.

-queue-take!clj/s

(-queue-take! this)

Takes an item from the queue, parking or blocking until an element is available or queue closed.

Takes an item from the queue, parking or blocking until an element is available or queue closed.
raw docstring

IRefclj/sprotocol

Protocol for thread-safe atomic effect state cells.

Protocol for thread-safe atomic effect state cells.

-ref-getclj/s

(-ref-get this)

Returns the current value of the Ref.

Returns the current value of the Ref.

-ref-set!clj/s

(-ref-set! this new-val)

Sets the Ref to new-val and returns new-val.

Sets the Ref to `new-val` and returns `new-val`.

-ref-update!clj/s

(-ref-update! this f)

Atomically updates the Ref with f and returns the new value.

Atomically updates the Ref with `f` and returns the new value.
raw docstring

ISemaphoreclj/sprotocol

Protocol for counting semaphores controlling concurrent resource access.

Protocol for counting semaphores controlling concurrent resource access.

-sem-acquire!clj/s

(-sem-acquire! this)
(-sem-acquire! this n)

Acquires n permits (default 1), blocking or parking until available.

Acquires `n` permits (default 1), blocking or parking until available.

-sem-available-permitsclj/s

(-sem-available-permits this)

Returns the number of permits currently available.

Returns the number of permits currently available.

-sem-release!clj/s

(-sem-release! this)
(-sem-release! this n)

Releases n permits (default 1) back to the semaphore.

Releases `n` permits (default 1) back to the semaphore.

-sem-try-acquire!clj/s

(-sem-try-acquire! this)
(-sem-try-acquire! this n)
(-sem-try-acquire! this n timeout-ms)

Attempts to acquire n permits. Returns true if acquired, false otherwise.

Attempts to acquire `n` permits. Returns true if acquired, false otherwise.
raw docstring

latch?clj/s

(latch? x)

Returns true if x satisfies the ILatch protocol.

Returns true if `x` satisfies the ILatch protocol.
raw docstring

queue?clj/s

(queue? x)

Returns true if x satisfies the IQueue protocol.

Returns true if `x` satisfies the IQueue protocol.
raw docstring

ref?clj/s

(ref? x)

Returns true if x satisfies the IRef protocol.

Returns true if `x` satisfies the IRef protocol.
raw docstring

semaphore?clj/s

(semaphore? x)

Returns true if x satisfies the ISemaphore protocol.

Returns true if `x` satisfies the ISemaphore protocol.
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close