☰

clojerl

0.7.0+build.2033.refc431a40

  • Home
  • API Reference

Modules

  • clj_analyzer
  • clj_behaviour
  • clj_cache
  • clj_compiler
  • clj_edn
  • clj_emitter
  • clj_emitter_pattern
  • clj_env
  • clj_hash_collision
  • clj_module
  • clj_multimethod
  • clj_murmur3
  • clj_protocol
  • clj_reader
  • clj_rt
  • clj_scope
  • clj_utils
  • clj_vector
  • clojerl
  • core_eval
  • Basic Types

  • clojerl.BitString
  • clojerl.Boolean
  • clojerl.Float
  • clojerl.Fn
  • clojerl.Integer
  • clojerl.Keyword
  • clojerl.Nil
  • clojerl.String
  • clojerl.Symbol
  • erlang.Fn
  • erlang.Port
  • erlang.Process
  • erlang.Reference
  • erlang.Type
  • erlang.util.Date
  • erlang.util.Regex
  • erlang.util.UUID
  • Namespaces & Vars

  • clojerl.Namespace
  • clojerl.Var
  • Collections & Data Structures

  • clojerl.Cons
  • clojerl.Cycle
  • clojerl.Iterate
  • clojerl.LazySeq
  • clojerl.List
  • clojerl.Map
  • clojerl.Range
  • clojerl.Repeat
  • clojerl.Set
  • clojerl.SortedMap
  • clojerl.SortedSet
  • clojerl.TupleMap
  • clojerl.Vector
  • erlang.List
  • erlang.Map
  • erlang.Tuple
  • Concurrency

  • clojerl.Agent
  • clojerl.Atom
  • clojerl.Delay
  • clojerl.Future
  • clojerl.ProcessVal
  • clojerl.Promise
  • I/O

  • erlang.io.File
  • erlang.io.PushbackReader
  • erlang.io.StringReader
  • erlang.io.StringWriter
  • Errors

  • clojerl.ArityError
  • clojerl.AssertionError
  • clojerl.BadArgumentError
  • clojerl.Error
  • clojerl.ExceptionInfo
  • clojerl.IllegalAccessError
  • Protocols

  • clojerl.IAssociative
  • clojerl.IBlockingDeref
  • clojerl.IChunk
  • clojerl.IChunkedSeq
  • clojerl.IColl
  • clojerl.ICounted
  • clojerl.IDeref
  • clojerl.IEncodeClojure
  • clojerl.IEncodeErlang
  • clojerl.IEquiv
  • clojerl.IError
  • clojerl.IExceptionInfo
  • clojerl.IFn
  • clojerl.IHash
  • clojerl.IIndexed
  • clojerl.IKVReduce
  • clojerl.ILookup
  • clojerl.IMap
  • clojerl.IMeta
  • clojerl.INamed
  • clojerl.IOError
  • clojerl.IPending
  • clojerl.IRecord
  • clojerl.IReduce
  • clojerl.IReference
  • clojerl.IReversible
  • clojerl.ISeq
  • clojerl.ISeqable
  • clojerl.ISequential
  • clojerl.ISet
  • clojerl.ISorted
  • clojerl.IStack
  • clojerl.IStringable
  • clojerl.IType
  • clojerl.IVector
  • erlang.io.ICloseable
  • erlang.io.IPushbackReader
  • erlang.io.IReader
  • erlang.io.IWriter

clojerl.Agent

Clojure Agent.

Summary

Types

  • type()

Functions

  • dispatch(Agent, Fun, Args)
    Dispatch an action to an agent.
  • error(Agent)
    Returns the error thrown during an asynchronous action of the agent if the agent is failed.
  • error_handler(Agent)
    Returns the error-handler of Agent, or undefined if there is none.
  • error_handler(Agent, ErrorHandler)
    Sets the error-handler of Agent a to ErrorHandler.
  • error_mode(Agent)
    Returns the error-mode of Agent.
  • error_mode(Agent, ErrorMode)
    Sets the error-mode of Agent a to ErrorMode, which must be either fail or continue.
  • release_pending_sends()
    Normally, actions sent directly or indirectly during another action are held until the action completes (changes the agent's state).
  • restart(Agent, NewValue, ClearActions)
    When an agent is failed, changes the agent state to new-state and then un-fails the agent so that sends are allowed again.
  • validator(Agent)
    Gets the validator function for the Agent.
  • validator(Agent, Validator)
    Sets the validator function for the Agent.

Types

type()
-type type() ::
          #{'__type__' => 'clojerl.Agent', id => binary(), pid => pid()}.

Functions

dispatch(Agent, Fun, Args)
-spec dispatch(type(), any(), any()) -> type().

Dispatch an action to an agent.

error(Agent)
-spec error(type()) -> any().

Returns the error thrown during an asynchronous action of the agent if the agent is failed. Returns undefined if the agent is not failed.

error_handler(Agent)
-spec error_handler(type()) -> function().

Returns the error-handler of Agent, or undefined if there is none.

error_handler(Agent, ErrorHandler)
-spec error_handler(type(), function()) -> any().

Sets the error-handler of Agent a to ErrorHandler.

error_mode(Agent)
-spec error_mode(type()) -> atom().

Returns the error-mode of Agent.

error_mode(Agent, ErrorMode)
-spec error_mode(type(), fail | continue) -> any().

Sets the error-mode of Agent a to ErrorMode, which must be either fail or continue.

release_pending_sends()
-spec release_pending_sends() -> non_neg_integer().

Normally, actions sent directly or indirectly during another action are held until the action completes (changes the agent's state). This function can be used to dispatch any pending sent actions immediately. If no action is occurring, does nothing. Returns the number of actions dispatched.

restart(Agent, NewValue, ClearActions)
-spec restart(type(), any(), boolean()) -> any().

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

validator(Agent)
-spec validator(type()) -> any().

Gets the validator function for the Agent.

validator(Agent, Validator)
-spec validator(type(), function()) -> any().

Sets the validator function for the Agent.