/// <summary> /// Create an encapsulated message to an agent. /// </summary> /// <param name="agent">The agent the message is for.</param> /// <param name="fn">The function to compute the new value.</param> /// <param name="args">Additional arguments (in addition to the current state).</param> /// <param name="solo">Execute on its own thread?</param> public Action(Agent agent, IFn fn, ISeq args, bool solo) { _agent = agent; _fn = fn; _args = args; _solo = solo; }
public IRef removeWatch(Agent watcher) { _watchers = _watchers.without(watcher); return this; }
public IRef addWatch(Agent watcher, IFn action, bool sendOff) { _watchers = _watchers.assoc(watcher, new object[] { action, sendOff }); return this; }
/// <summary> /// Add an agent action sent during the transaction to a queue. /// </summary> /// <param name="action">The action that was sent.</param> internal void Enqueue(Agent.Action action) { _actions.Add(action); }