diff --git a/akka-core/src/main/scala/actor/Agent.scala b/akka-core/src/main/scala/actor/Agent.scala index ab08b48ec9..697b53d797 100644 --- a/akka-core/src/main/scala/actor/Agent.scala +++ b/akka-core/src/main/scala/actor/Agent.scala @@ -36,6 +36,9 @@ class AgentException private[akka](message: String) extends RuntimeException(mes * * The code that is submitted to an agent doesn't need to pay attention to * threading or synchronization, the agent will provide such guarantees by itself. +* +* If an Agent is used within an enclosing transaction, then it will participate +* in that transaction. * * Example of usage: *
@@ -49,14 +52,18 @@ class AgentException private[akka](message: String) extends RuntimeException(mes * * agent.close *-* -* @author Vaclav Pech -* Date: Oct 18, 2009 -* -* Inital AKKA port by -* @author Viktor Klang -* Date: Jan 24 2010 * +* NOTE: You can't call 'agent.get' or 'agent()' within an enclosing transaction since +* that will block the transaction indefinitely. But 'agent.update' or 'Agent(value)' +* is fine. +* +* Original author: +* @author Vaclav Pech +* +* Inital AKKA port by: +* @author Viktor Klang +* +* Modifications by: * @author Jonas Bonér */ sealed class Agent[T] private (initialValue: T) extends Transactor {