Could you do this by changing listen()?
On Tue, Oct 18, 2016 at 11:42 AM, Yury Selivanov <yseliva...@gmail.com> wrote:
> No, I don’t think we have an API for that. I suppose you can make a PR (or
> open an issue) at github.com/python/asyncio 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.
>> On Oct 18, 2016, at 2:39 PM, Justin Mayfield <too...@gmail.com> 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.
--Guido van Rossum (python.org/~guido)