Skip to main content

Concurrency

  • agent

    Creates and returns an agent with an initial value of state and zero or more options (in any order): :meta metadata...

  • agent-error

    Returns the exception thrown during an asynchronous action of the agent if the agent is failed. Returns nil if the ag...

  • await

    Blocks the current thread (indefinitely!) until all actions dispatched thus far, from this thread or agent, to the age...

  • await-for

    Blocks the current thread until all actions dispatched thus far (from this thread or agent) to the agents have occurre...

  • error-handler

    Returns the error-handler of agent a, or nil if there is none. See set-error-handler!

  • error-mode

    Returns the error-mode of agent a. See set-error-mode!

  • release-pending-sends

    Normally, actions sent directly or indirectly during another action are held until the action completes (changes the a...

  • restart-agent

    When an agent is failed, changes the agent state to new-state and then un-fails the agent so that sends are allowed ag...

  • send

    Dispatch an action to an agent. Returns the agent immediately. Subsequently, in a thread from a thread pool, the state...

  • send-off

    Dispatch a potentially blocking action to an agent. Returns the agent immediately. Subsequently, in a separate thread,...

  • send-via

    Dispatch an action to an agent. Returns the agent immediately. Subsequently, in a thread supplied by executor, the sta...

  • set-agent-send-executor!

    Sets the ExecutorService to be used by send

  • set-agent-send-off-executor!

    Sets the ExecutorService to be used by send-off

  • set-error-handler!

    Sets the error-handler of agent a to handler-fn. If an action being run by the agent throws an exception or doesn't p...

  • set-error-mode!

    Sets the error-mode of agent a to mode-keyword, which must be either :fail or :continue. If an action being run by th...

  • shutdown-agents

    Initiates a shutdown of the thread pools that back the agent system. Running actions will complete, but no new actions...

  • atom

    Creates and returns an Atom with an initial value of x and zero or more options (in any order): :meta metadata-map ...

  • compare-and-set!

    Atomically sets the value of atom to newval if and only if the current value of the atom is identical to oldval. Retur...

  • reset!

    Sets the value of atom to newval without regard for the current value. Returns newval.

  • reset-vals!

    Sets the value of atom to newval. Returns [old new], the value of the atom before and after the reset.

  • swap!

    Atomically swaps the value of atom to be: (apply f current-value-of-atom args). Note that f may be called multiple t...

  • swap-vals!

    Atomically swaps the value of atom to be: (apply f current-value-of-atom args). Note that f may be called multiple t...

  • deliver

    Delivers the supplied value to the promise, releasing any pending derefs. A subsequent call to deliver on a promise wi...

  • deref

    Also reader macro: @ref/@agent/@var/@atom/@delay/@future/@promise. Within a transaction, returns the in-transaction-va...

  • future

    Takes a body of expressions and yields a future object that will invoke the body in another thread, and will cache the...

  • future

    Like clojure.core/future but also conveys sci bindings to the thread.

  • future-call

    Takes a function of no args and yields a future object that will invoke the function in another thread, and will cache...

  • future-cancel

    Cancels the future, if possible.

  • future-cancelled?

    Returns true if future f is cancelled

  • future-done?

    Returns true if future f is done

  • future?

    Returns true if x is a future

  • promise

    Returns a promise object that can be read with deref/@, and set, once only, with deliver. Calls to deref/@ prior to de...

  • realized?

    Returns true if a value has been produced for a promise, delay, future or lazy sequence.

  • locking

    Executes exprs in an implicit do, while holding the monitor of x. Will release the monitor of x in all circumstances.

  • pmap

    Like clojure.core/pmap but also conveys sci bindings to the threads.

  • seque

    Creates a queued seq on another (presumably lazy) seq s. The queued seq will produce a concrete seq in the background,...

  • volatile!

    Creates and returns a Volatile with an initial value of val.

  • volatile?

    Returns true if x is a volatile.

  • vreset!

    Sets the value of volatile to newval without regard for the current value. Returns newval.

  • vswap!

    Non-atomically swaps the value of the volatile as if: (apply f current-value-of-vol args). Returns the value that ...

  • alter

    Must be called in a transaction. Sets the in-transaction-value of ref to: (apply fun in-transaction-value-of-ref ar...

  • commute

    Must be called in a transaction. Sets the in-transaction-value of ref to: (apply fun in-transaction-value-of-ref ar...

  • dosync

    Runs the exprs (in an implicit do) in a transaction that encompasses exprs and any nested calls. Starts a transaction...

  • ensure

    Must be called in a transaction. Protects the ref from modification by other transactions. Returns the in-transaction...

  • ref

    Creates and returns a Ref with an initial value of x and zero or more options (in any order): :meta metadata-map ...

  • ref-history-count

    Returns the history count of a ref

  • ref-max-history

    Gets the max-history of a ref, or sets it and returns the ref

  • ref-min-history

    Gets the min-history of a ref, or sets it and returns the ref

  • ref-set

    Must be called in a transaction. Sets the value of ref. Returns val.

  • sync

    transaction-flags => TBD, pass nil for now Runs the exprs (in an implicit do) in a transaction that encompasses expr...