Hi Jean,

calling “connection handleWith myFlow” is a really quick operation, hence you 
see no back-pressure kicking in. The feature you are after is currently rather 
awkward to implement, you’d have to replace handleWith with manually joining 
and running the connection’s Flow in order to obtain a Future for its 
termination, and then you’d mapAsync into a BlackholeSink instead of using a 
ForeachSink.

Since this is a common thing people will want to do, we will provide this (or 
an equivalent solution) with Akka HTTP; this is one of the joys of using 
development previews :-) But thanks for reporting in any case!

Regards,

Roland

> 26 jan 2015 kl. 10:04 skrev Jean Rossier <[email protected]>:
> 
> I would have expected some failed requests.
> In my test, I'm sending 200 concurrent requests (the processing of each 
> request takes circa 200ms), Since I have a buffer of 5, I thought that some 
> requests would have been dropped and my client would have received some 
> errors. But, in my test, all requests are replied sucessfully.
> I thought OverflowStrategy.dropTail would drop the incoming requests when the 
> buffer is full.
> 
> Jean
> 
> On Monday, January 26, 2015 at 9:38:36 AM UTC+1, drewhk wrote:
> Hi Jean,
> 
> On Mon, Jan 26, 2015 at 9:03 AM, Jean Rossier <[email protected] 
> <javascript:>> wrote:
> Hello,
> 
> I'm wondering if there is a way to use back-pressure mechanism on incoming 
> connections with Akka HTTP ? 
> The documentation mentions clearly that there is no back-pressure applied to 
> the connections Source if we use the startHandlingWith* functions 
> (http://doc.akka.io/api/akka-stream-and-http-experimental/1.0-M2/?_ga=1.267496717.2041479737.1421658563#akka.http.Http$$ServerBinding
>  
> <http://doc.akka.io/api/akka-stream-and-http-experimental/1.0-M2/?_ga=1.267496717.2041479737.1421658563#akka.http.Http$$ServerBinding>).
>  Therefore, I tried to do something like the following:
> val serverBinding = Http(system).bind(interface = "localhost", port = port)
> serverBinding.connections.buffer(5, 
> OverflowStrategy.dropTail).to(ForeachSink(_ handleWith myFlow)).run()
> 
> But, when sending a bunch of concurrent connections to my server, the buffer 
> in the above code doesn't seem to have any effect.
> 
> What do yo mean it had no effect? What did you expect it do do and what 
> happened? What do you think OverflowStrategy.dropTail will do here?
> 
> -Endre
>  
> Am I doing anything wrong ?
> 
> Cheers,
> Jean
> 
> -- 
> >>>>>>>>>> Read the docs: http://akka.io/docs/ <http://akka.io/docs/>
> >>>>>>>>>> Check the FAQ: 
> >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html 
> >>>>>>>>>> <http://doc.akka.io/docs/akka/current/additional/faq.html>
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user 
> >>>>>>>>>> <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] <javascript:>.
> To post to this group, send email to [email protected] <javascript:>.
> Visit this group at http://groups.google.com/group/akka-user 
> <http://groups.google.com/group/akka-user>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.
> 
> 
> -- 
> >>>>>>>>>> Read the docs: http://akka.io/docs/ <http://akka.io/docs/>
> >>>>>>>>>> Check the FAQ: 
> >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html 
> >>>>>>>>>> <http://doc.akka.io/docs/akka/current/additional/faq.html>
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user 
> >>>>>>>>>> <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] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.
> Visit this group at http://groups.google.com/group/akka-user 
> <http://groups.google.com/group/akka-user>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.



Dr. Roland Kuhn
Akka Tech Lead
Typesafe <http://typesafe.com/> – Reactive apps on the JVM.
twitter: @rolandkuhn
 <http://twitter.com/#!/rolandkuhn>

-- 
>>>>>>>>>>      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