Hi guys,
That's an interesting area you work in Greg :-)
You seem to already use work-pulling, so while small tweaks can be done
that seams the way to go for me.
And don't worry too much about the downloads until they actually clog
something - you can look at the threads using visualvm to get a brief
overview if they're running as expected (nio).

On Sat, Jul 19, 2014 at 6:57 PM, Soumya Simanta <soumya.sima...@gmail.com>
wrote:

> You can have a parent actor that spawns multiple child actors (in this
> case 3). Each of this child actor is responsible for send the requests to
> the external service and waiting for the result. Ideally I would recommend
> using Spray client to handle this. Can the server side of the service
> maintain stream state ? (i.e., can it resume in case of an error, network
> disconnect etc).
>
> Now in the parent actor you can have two states ( def canHandleMore :
> Receive and def noMoreRequests: Receive) and keep a count of how many
> child actors are created from the canHandleMore state. Change the state
> of the parent actor by using "become noMoreRequests" when you reach your
> threshold (in this case 3). The workers should similarly send a message
> back to the parent when they are done and the parent can go back to  "
> become canHandleMore". You can return a message back to the client from
> the noMoreRequest state.
>
>
>
>
> On Friday, July 18, 2014 2:54:45 AM UTC-4, Greg Flanagan wrote:
>>
>> I have an actor that makes an http call that can take a long time to
>> complete (i.e. 10 - 30 minutes). I only want to be hitting the service at
>> most 3 at once so I don't want the actors to consume more messages until
>> the current call is finished. I've got it all working great using the work
>> pulling pattern with three worker nodes. My question, or really concern is,
>> is it a good idea to keep an http connection open for so long? are there
>> any implications for doing so? what kind of things should I look out for?
>> Since I'm using NIO for the http call I shouldn't be using up a thread most
>> of the time. I'm use to http calls finishing on the order or milliseconds
>> not minutes.
>>
>> Cheers,
>> Greg
>>
>  --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ:
> http://doc.akka.io/docs/akka/current/additional/faq.html
> >>>>>>>>>> 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 akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Cheers,
Konrad 'ktoso' Malawski
hAkker @ Typesafe

<http://typesafe.com>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to