From ce41e170ddb20c5bfbfefdd953d0143463c6e133 Mon Sep 17 00:00:00 2001 From: Peter Vlugter Date: Thu, 10 Jun 2010 13:16:09 +1200 Subject: [PATCH] Removed for-comprehensions for transactions --- .../src/main/scala/stm/Transaction.scala | 106 ------------------ 1 file changed, 106 deletions(-) diff --git a/akka-core/src/main/scala/stm/Transaction.scala b/akka-core/src/main/scala/stm/Transaction.scala index eb6607e102..20b9ceb54e 100644 --- a/akka-core/src/main/scala/stm/Transaction.scala +++ b/akka-core/src/main/scala/stm/Transaction.scala @@ -57,61 +57,10 @@ object Transaction { * } * * - * Example of atomic transaction management using for comprehensions (monadic): - * - *
-   * import se.scalablesolutions.akka.stm.Transaction.Local._
-   * for (tx <- Transaction.Local)  {
-   *   ... // do transactional stuff
-   * }
-   *
-   * val result = for (tx <- Transaction.Local) yield  {
-   *   ... // do transactional stuff yielding a result
-   * }
-   * 
- * - * Example of using Transaction and TransactionalRef in for comprehensions (monadic): - * - *
-   * // For example, if you have a List with TransactionalRef
-   * val refs: List[TransactionalRef] = ...
-   *
-   * // You can use them together with Transaction in a for comprehension since
-   * // TransactionalRef is also monadic
-   * for  {
-   *   tx <- Transaction.Local
-   *   ref <- refs
-   * } {
-   *   ... // use the ref inside a transaction
-   * }
-   *
-   * val result = for  {
-   *   tx <- Transaction.Local
-   *   ref <- refs
-   * } yield  {
-   *   ... // use the ref inside a transaction, yield a result
-   * }
-   * 
- * * @author Jonas Bonér */ object Local extends TransactionManagement with Logging { - /** - * See ScalaDoc on Transaction.Local class. - */ - def map[T](f: => T): T = atomic {f} - - /** - * See ScalaDoc on Transaction.Local class. - */ - def flatMap[T](f: => T): T = atomic {f} - - /** - * See ScalaDoc on Transaction.Local class. - */ - def foreach(f: => Unit): Unit = atomic {f} - /** * See ScalaDoc on Transaction.Local class. */ @@ -156,65 +105,10 @@ object Transaction { * } * * - * Example of atomic transaction management using for comprehensions (monadic): - * - *
-   * import se.scalablesolutions.akka.stm.Transaction
-   * for (tx <- Transaction.Global)  {
-   *   ... // do transactional stuff
-   * }
-   *
-   * val result = for (tx <- Transaction.Global) yield  {
-   *   ... // do transactional stuff yielding a result
-   * }
-   * 
- * - * Example of using Transaction and TransactionalRef in for comprehensions (monadic): - * - *
-   * // For example, if you have a List with TransactionalRef
-   * val refs: List[TransactionalRef] = ...
-   *
-   * // You can use them together with Transaction in a for comprehension since
-   * // TransactionalRef is also monadic
-   * for  {
-   *   tx <- Transaction.Global
-   *   ref <- refs
-   * } {
-   *   ... // use the ref inside a transaction
-   * }
-   *
-   * val result = for  {
-   *   tx <- Transaction.Global
-   *   ref <- refs
-   * } yield  {
-   *   ... // use the ref inside a transaction, yield a result
-   * }
-   * 
- * * @author Jonas Bonér */ object Global extends TransactionManagement with Logging { - /** - * See ScalaDoc on Transaction.Global class. - */ - def map[T](f: => T): T = atomic {f} - - /** - * See ScalaDoc on Transaction.Global class. - */ - def flatMap[T](f: => T): T = atomic {f} - - /** - * See ScalaDoc on Transaction.Global class. - */ - def foreach(f: => Unit): Unit = atomic {f} - - -// FIXME tryJoinCommit(mtx, TransactionManagement.TRANSACTION_TIMEOUT, TimeUnit.MILLISECONDS) -//getTransactionSetInScope.tryJoinCommit(mtx, TransactionManagement.TRANSACTION_TIMEOUT, TimeUnit.MILLISECONDS) - /** * See ScalaDoc on Transaction.Global class. */