summaryrefslogtreecommitdiff
path: root/src/clj
diff options
context:
space:
mode:
authorRich Hickey <richhickey@gmail.com>2008-12-23 19:23:34 +0000
committerRich Hickey <richhickey@gmail.com>2008-12-23 19:23:34 +0000
commitc29ccf985770f751a41f7e5728938af0316b5dfe (patch)
tree83d8c0c52c943303f106ca0c1d364eb48c5ce5bf /src/clj
parent7d603560e3a43ba8e787a38312319ff0d6139b54 (diff)
added release-pending-sends
Diffstat (limited to 'src/clj')
-rw-r--r--src/clj/clojure/core.clj9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/clj/clojure/core.clj b/src/clj/clojure/core.clj
index 4cb7fd66..c6e81bad 100644
--- a/src/clj/clojure/core.clj
+++ b/src/clj/clojure/core.clj
@@ -1074,6 +1074,15 @@
[#^clojure.lang.Agent a f & args]
(. a (dispatch f args true)))
+(defn release-pending-sends
+ "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. This has no impact on actions sent during a
+ transaction, which are still held until commit. If no action is
+ occurring, does nothing. Returns the number of actions dispatched."
+ [] (clojure.lang.Agent/releasePendingSends))
+
(defn add-watch
"Experimental.
Adds a watcher to an agent. Whenever the agent runs an action, any