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
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
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
:) 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
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/
>
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
>
> 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