Given:

val system = ActorSystem("test")
val http = IO(Http)(system)
def fetch = http ! HttpRequest(GET, "http://0.0.0.0:8080/loadtest";)


If I were to do:

(0 to 25).foreach(_ => fetch)


I would expect that the code would fire off 25 asynchronous requests. What 
happens instead is that four requests are set off. They wait for a 
response. When the response to all 4 comes back then four more are sent off 
until all 25 are processed.

I tried tweaking with Spray's configuration to create a custom dispatcher 
but this had no effect...

outbound-http-dispatcher {
  type = Dispatcher
  executor = "thread-pool-executor"
  throughput = 250
}

spray.can {
  host-connector-dispatcher = outbound-http-dispatcher
  manager-dispatcher = outbound-http-dispatcher
}


How can I configure Akka/Spray to send off all 25 requests asynchronously?

Using: Akka 2.2.3, Spray 1.2.0

-- 
>>>>>>>>>>      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 [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/d/optout.

Reply via email to