Re: newbie question on agent/transaction

2015-07-15 Thread William la Forge
Or perhaps find a way to extend agents. hm? On Wednesday, July 15, 2015 at 9:45:29 AM UTC-4, William la Forge wrote: > > Thanks, Ragnar. > > My reason for asking is that I've implemented a robust form of actor in > Java https://github.com/laforge49/JActor2 and want to play with a > simplified ve

Re: newbie question on agent/transaction

2015-07-15 Thread William la Forge
Thanks, Ragnar. My reason for asking is that I've implemented a robust form of actor in Java https://github.com/laforge49/JActor2 and want to play with a simplified version in Clojure as a first project in the language. But I'm just hardly getting started. I've only been looking at Clojure for

Re: newbie question on agent/transaction

2015-07-15 Thread Ragnar Dahlén
You can check with `(clojure.lang.LockingTransaction/isRunning)` (the io! macro does this) but I'm not sure if it's considered a public API. https://github.com/clojure/clojure/blob/f6a90ff2931cec35cca0ca7cf7afe90ab99e3161/src/clj/clojure/core.clj#L2390 On Wednesday, 15 July 2015 13:53:11 UTC+1,

Re: newbie question on agent/transaction

2015-07-15 Thread Ragnar Dahlén
Hi Bill, You are correct in that this involves close integration with the STM. The agent implementation is aware of transactions and if a transaction is running when dispatching an action, it will be enqneued in a special agent action queue that STM implementation respects. AFAIK there is no p

newbie question on agent/transaction

2015-07-15 Thread William la Forge
On this page http://clojure.org/agents I read the following: "Agents are integrated with the STM - any dispatches made in a transaction are held until it commits, and are discarded if it is retried or aborted." So there must be a way to tell if a dispatch is made from within a transaction.