Liking cljdoc? Tell your friends :D

loom-otp.process.receive

Message receive functions.

This namespace provides function-based receive operations:

  • receive! - FIFO receive, returns message or :timeout
  • selective-receive! - predicate-based receive, scans mailbox

For pattern-matching macros, see loom-otp.process.match.

Message receive functions.

This namespace provides function-based receive operations:
- receive! - FIFO receive, returns message or :timeout
- selective-receive! - predicate-based receive, scans mailbox

For pattern-matching macros, see loom-otp.process.match.
raw docstring

receive!clj

(receive!)
(receive! timeout-ms timeout-val)

Receive the next message from the mailbox (FIFO order).

Arities:

  • [] - block forever until message arrives
  • [timeout-ms timeout-val] - wait up to timeout-ms, return timeout-val on timeout

Message context is automatically merged into the process's context. Throws InterruptedException if the process is killed while waiting.

Receive the next message from the mailbox (FIFO order).

Arities:
- [] - block forever until message arrives
- [timeout-ms timeout-val] - wait up to timeout-ms, return timeout-val on timeout

Message context is automatically merged into the process's context.
Throws InterruptedException if the process is killed while waiting.
sourceraw docstring

selective-receive!clj

(selective-receive! match-fn)
(selective-receive! match-fn timeout-ms)

Receive first message matching predicate, with optional timeout.

Unlike receive!, this scans the mailbox for a matching message rather than taking FIFO. Non-matching messages remain in the mailbox in their original order.

match-fn is called with the unwrapped message (not [ctx msg]). Returns the unwrapped message, or :timeout if no match found within timeout.

Message context is automatically merged into the process's context. Throws InterruptedException if the process is killed while waiting.

Receive first message matching predicate, with optional timeout.

Unlike receive!, this scans the mailbox for a matching message
rather than taking FIFO. Non-matching messages remain in the mailbox
in their original order.

match-fn is called with the unwrapped message (not [ctx msg]).
Returns the unwrapped message, or :timeout if no match found within timeout.

Message context is automatically merged into the process's context.
Throws InterruptedException if the process is killed while waiting.
sourceraw 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