From aeea8d38dc395945084cf4b69cc285cf1c3eb22d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Bon=C3=A9r?= Date: Sat, 20 Mar 2010 10:15:58 +0100 Subject: [PATCH] Improved Agent doc --- akka-core/src/main/scala/actor/Agent.scala | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) 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 {