I have looked around some sample codes for Ask in Scala's Actor, all of which have implicitly set the timeout as implicit val timeout=Timeout(5seconds)
as shown in the following URL:
Does that mean that it is not possible to set it individually with the second argument of Wait.result?
http://alvinalexander.com/scala/scala-akka-actors-ask-examples-future-await-timeout-result
http://kimutansk.hatenablog.com/entry/20140726/1406330944
https://stackoverflow.com/questions/20124072/akka-the-proper-use-of-ask-pattern
I think it's probably this one, so
http://doc.akka.io/api/akka/2.4.2/ #akka.pattern.AskableActorRef
def?(message:Any) (implicit timeout:Timeout, sender:ActorRef=Actor.noSender): Future [Any]
In other words,
actor.?(message) (Timeout (5 seconds))
or
actor.?(message)(Timeout(5 seconds),implicitly [ActorRef])
I think we can do it with
In other words, scala has several argument groups and is shaped like def method(a:Int, b:Long)(c:Byte)
.When calling, write something like method(a,b)(c)
. If implicit is a declaration such as def method(a:Int,b:Long)(implicit c:Byte)
, look for a Byte type variable declared by explicit val, etc. implicitly [ActorRef]
is a function that explicitly takes implicit arguments (details>).
613 GDB gets version error when attempting to debug with the Presense SDK (IDE)
574 Who developed the "avformat-59.dll" that comes with FFmpeg?
916 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
573 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
© 2024 OneMinuteCode. All rights reserved.