Skip to main content

Agents

17
  • 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...