scala - Akka 2.4.6 - where is ask (or ?) method? -
i learning play akka , scala.
the akka documentation says can message actor using ?
or ask
method. there no ?
or ask
in actorref class in version of akka using (2.4.6).
was moved somewhere or deprecated?
was moved somewhere or deprecated?
no. ?
defined implicit def inside asksupport
trait , implicit conversion actorref
type:
object askpattern { implicit class askable[t](val ref: actorref[t]) extends anyval { def ?[u](f: actorref[u] ⇒ t)(implicit timeout: timeout): future[u] = ask(ref, timeout, f) }
as can see, implicit works actorref
, implicit class accepts 1 argument of said type. means ?
method applicable actorref
via implicit conversion.
as @sergey notes in comments, in order bring implicit in scope, you'll need import akka.pattern.ask
Comments
Post a Comment