=str #22448 rewrite Source.empty to GraphStage

This commit is contained in:
Konrad `ktoso` Malawski 2017-03-03 15:20:37 +01:00
parent 0367812e40
commit e47dbda154
6 changed files with 115 additions and 10 deletions

View file

@ -0,0 +1,38 @@
/**
* Copyright (C) 2009-2017 Lightbend Inc. <http://www.lightbend.com>
*/
package docs.actor
import akka.actor.ActorLogging
import scala.language.postfixOps
import akka.Done
import akka.actor.{ ActorRef, CoordinatedShutdown }
import akka.testkit._
import akka.util._
import scala.concurrent.{ Await, Future }
import scala.concurrent.duration._
import akka.actor.ActorSystem
import akka.actor.Actor
import akka.actor.Props
import akka.testkit.{ ImplicitSender, TestKit }
class LOLSPEC extends AkkaSpec(Map("akka.loglevel" -> "INFO")) {
"schedule a one-off task" in {
val miku = system.actorOf(Props(new Actor {
def receive = {
case x =>
println(s"sender() = ${sender()}")
}
}))
system.eventStream.subscribe(miku, classOf[Object])
system.eventStream.publish("Hello!")
}
}