Merge remote-tracking branch 'origin/master' into wip-2.10.0-RC1-∂π
- currently cheating: uses zeroMQ artifacts for scala 2.10M7 - fixed a bunch of more wrong references to scala.concurrent.util
This commit is contained in:
commit
bff79c2f94
47 changed files with 1036 additions and 287 deletions
|
|
@ -270,10 +270,16 @@ class ActorDocSpec extends AkkaSpec(Map("akka.loglevel" -> "INFO")) {
|
|||
import akka.actor.ReceiveTimeout
|
||||
import scala.concurrent.duration._
|
||||
class MyActor extends Actor {
|
||||
// To set an initial delay
|
||||
context.setReceiveTimeout(30 milliseconds)
|
||||
def receive = {
|
||||
case "Hello" ⇒ //...
|
||||
case ReceiveTimeout ⇒ throw new RuntimeException("received timeout")
|
||||
case "Hello" ⇒
|
||||
// To set in a response to a message
|
||||
context.setReceiveTimeout(100 milliseconds)
|
||||
case ReceiveTimeout ⇒
|
||||
// To turn it off
|
||||
context.setReceiveTimeout(Duration.Undefined)
|
||||
throw new RuntimeException("Receive timed out")
|
||||
}
|
||||
}
|
||||
//#receive-timeout
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue