Permalink
Browse files

Added comment about operating inside an actor.

  • Loading branch information...
henrikengstrom committed Nov 20, 2012
1 parent 41fadb6 commit 5812775cd332b784dd1040b64b385c2c6f2896ed
Showing with 3 additions and 0 deletions.
  1. +3 −0 service/src/main/scala/com/typesafe/akkademo/service/BettingService.scala
@@ -20,6 +20,9 @@ case object HandleUnprocessedBets
class BettingService extends Actor with ActorLogging {
val ActivePeriod = 2000L
+ // PLEASE NOTE THAT USING AN ATOMICINTEGER IN THIS CONTEXT IS AN ANTIPATTERN!
+ // Inside the actor you're in a thread safe environment so you can simply use an integer in this case.
+ // The AtomicInteger here is used to discuss this topic during the kata, hence its existence.
val sequence = new AtomicInteger(1)
var processor: Option[(ActorRef, Long)] = None

0 comments on commit 5812775

Please sign in to comment.