【发布时间】:2015-08-27 09:32:44
【问题描述】:
我正在尝试使用Source.actorRef 方法来创建akka.stream.scaladsl.Source 对象。某种形式的东西
import akka.stream.OverflowStrategy.fail
import akka.stream.scaladsl.Source
case class Weather(zip : String, temp : Double, raining : Boolean)
val weatherSource = Source.actorRef[Weather](Int.MaxValue, fail)
val sunnySource = weatherSource.filter(!_.raining)
...
我的问题是:如何将数据发送到基于 ActorRef 的 Source 对象?
我认为向源发送消息是某种形式
//does not compile
weatherSource ! Weather("90210", 72.0, false)
weatherSource ! Weather("02139", 32.0, true)
但是weatherSource 没有! 运算符或tell 方法。
documentation 没有过多描述如何使用 Source.actorRef,它只是说您可以...
提前感谢您的评论和回复。
【问题讨论】:
标签: scala akka akka-stream