Re 3.6 freeze, This is understandable.

I just wanted to make sure I wasn't missing something in the first place. 
 I can submit a PR/Issue that focuses on Server.pause_serving and 
resume_serving if that's the most sensible place for this.  A param to 
start_server such as `connection_limit` could be added later using those 
interfaces or I could add that in the same PR.

Mild tangent, while I was looking at the code I was wondering if it made 
sense to allow users to bring their own Server subclasses via an optional 
kwarg to create_server, along the lines of 

class MySuperServer(asyncio.Server):

my_super_server = await asyncio.start_server(..., 

Custom backpressure implementations could be made in Server subclasses this 


On Tuesday, October 18, 2016 at 12:43:02 PM UTC-6, Yury Selivanov wrote:
> Hi, 
> No, I don’t think we have an API for that.  I suppose you can make a PR 
> (or open an issue) at proposing to add 
> `pause_serving()`/`resume_serving()`.  I’m afraid we aren’t going to add 
> them until 3.7, since Python 3.6 is in feature freeze mode now. 
> Yury 
> > On Oct 18, 2016, at 2:39 PM, Justin Mayfield < 
> <javascript:>> wrote: 
> > 
> > Is there a public interface for controlling the connection limit on 
> servers created with `loop.create_server`?  Specifically a way to ~ 
> `remove_reader(_accept_connection)` temporarily. 
> > 
> > I've developed a statsd proxy for a client that needs to implement 
> backpressure all the way to the listening socket but I don't see a good way 
> to pause the _accept_connection handler that monitors the listening socket 
> for read events. 
> > 
> > I'd be happy to implement my own logic for the back pressure using a 
> public `pause_serving()`/`resume_serving()` API but a simple 
> `max_connections` param to the create_server would suffice too. 
> > 
> > Cheers, 
> > JM 

Reply via email to