Re: [akka-user] Re: Behavior of Akka when you sleep in an actor

2015-10-18 Thread Adam
I don't understand the purpose of "keeping the actor busy". Why not use the actor system's scheduler in order to implement the delay? Do you actually want to use CPU or other resources? The only thing to pay attention to is that the scheduler, has a certain precision, so the delay may turn out t

Re: [akka-user] Re: Behavior of Akka when you sleep in an actor

2015-10-18 Thread Harit Himanshu
A dumb question. I was in such a situation recently and have been sleeping threads in Java. I got so much used to it that now I had trouble telling Actor what "heavy work" it should do to stay busy. My solution was File.createTempFile("someRandom", "txt") couple of thousand time (so Actor was

Re: [akka-user] Re: Behavior of Akka when you sleep in an actor

2015-10-17 Thread Konrad Malawski
On Thu, Oct 15, 2015 at 4:44 AM, Fahimeh Rahemi wrote: > Please let me see if I understand your answer correctly, do you mean that > if I use thread.sleep(5000) inside an actor, the actor does not leave it's > thread at all? and the thread is idle and jobless for 5 seconds? > Yeah, exactly. It

[akka-user] Re: Behavior of Akka when you sleep in an actor

2015-10-14 Thread Fahimeh Rahemi
:) thank you from your answer! yes, I'm trying to test my actor system with dispatchers, and need both heavy and light weight actors for my test ; Please let me see if I understand your answer correctly, do you mean that if I use thread.sleep(5000) inside an actor, the actor does not leave it's

[akka-user] Re: Behavior of Akka when you sleep in an actor

2015-10-14 Thread Nicholas Sterling
Fahlmeh, hopefully you are talking about some form of test -- in a production system, you would not want to use thread.sleep. But to answer your question, yes -- if your actor calls thread.sleep, it really ties up a thread. Nicholas -- >> Read the docs: http://akka.io/docs/ >

Re: [akka-user] Re: Behavior of Akka when you sleep in an actor

2015-10-14 Thread Viktor Klang
Thread.sleep's behavior is documented here: https://docs.oracle.com/javase/7/docs/api/java/lang/Thread.html#sleep(long) On Wed, Oct 14, 2015 at 4:14 PM, Fahimeh Rahemi wrote: > Hi every body! > > I have a relative question; > I want to create some heavy and thread occupier actors by akka; by usi

[akka-user] Re: Behavior of Akka when you sleep in an actor

2015-10-14 Thread Fahimeh Rahemi
> > Hi every body! I have a relative question; I want to create some heavy and thread occupier actors by akka; by using thread.sleep(5000) are the threads associated to that actors really occupied?I mean when I use thread.sleep(5000) inside an actor, does the actor occupy the thread for 5 sec