Hi,

On Fri, Feb 21, 2014 at 7:41 AM, Chelley <[email protected]> wrote:

>
> Folks,
>
>   Looking at the API documentation, I am unable to infer what are the
> default units for implicit timeout: 
> Timeout<http://doc.akka.io/api/akka/2.0/akka/util/Timeout.html>
>
>
> if the user specifies a number in the timeout, I am assuming that it will
> assume the units of milliseconds.?. Can some one please confirm ?.
>

The implicit parameter is of type akka.util.Timeout, which wraps
a FiniteDuration that defines value and unit.
I would recommend against using the constructor/apply of Timeout that takes
the Long parameter, but yes, it is milliseconds.

/Patrik



>
> http://doc.akka.io/api/akka/2.0/akka/pattern/package.html
>
>
> defask (actorRef: 
> ActorRef<http://doc.akka.io/api/akka/2.0/akka/actor/ActorRef.html>
> , message: Any)(implicit timeout: 
> Timeout<http://doc.akka.io/api/akka/2.0/akka/util/Timeout.html>
> ): Future <http://doc.akka.io/api/akka/2.0/akka/dispatch/Future.html>[Any]
>
> Sends a message asynchronously and returns a 
> Future<http://doc.akka.io/api/akka/2.0/akka/dispatch/Future.html> holding
> the eventual reply message; this means that the target actor needs to send
> the result to the sender reference provided. The Future will be completed
> with an akka.actor.AskTimeoutException after the given timeout has expired;
> this is independent from any timeout applied while awaiting a result for
> this future (i.e. in Await.result(..., timeout)).
>
> *Warning:* When using future callbacks, inside actors you need to
> carefully avoid closing over the containing actor's object, i.e. do not
> call methods or access mutable state on the enclosing actor from within the
> callback. This would break the actor encapsulation and may introduce
> synchronization bugs and race conditions because the callback will be
> scheduled concurrently to the enclosing actor. Unfortunately there is not
> yet a way to detect these illegal accesses at compile time.
>
> *Recommended usage:*
>
>   val f = ask(worker, request)(timeout)
>   flow {
>     EnrichedRequest(request, f())
>   } pipeTo nextActor
>
> [see Future <http://doc.akka.io/api/akka/2.0/akka/dispatch/Future.html> for
> a description of flow]
> Definition 
> ClassesAskSupport<http://doc.akka.io/api/akka/2.0/akka/pattern/AskSupport.html>
>
> --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ: http://akka.io/faq/
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 

Patrik Nordwall
Typesafe <http://typesafe.com/> -  Reactive apps on the JVM
Twitter: @patriknw

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: http://akka.io/faq/
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to