繼documentation to implement a KillSwitch之後,我能夠編寫這個簡單的示例來停止Source發出無限數字。 object KillSwitchSample extends App {
implicit val actorSystem = ActorSystem()
implicit val materializer = ActorMateri
我正嘗試使用Akka流構建一個簡單的tcp服務器。 Tcp()
.bind(props.host, props.port)
.to(Sink.foreach(_.handleWith(handler)))
.run()
.onComplete {
case Success(i) => logger.info(s"Server is bound at