Pierce Lopez
Pierce Lopez
Here's how I do it (currently with tornado-4.5.3 but I expect it will work the same with tornado-5.1): ```python async def shutdown(): periodic_task.stop() http_server.stop() for client in ws_clients.values(): client['handler'].close() await...
sure, `ws_clients` in my case was a list of dicts with each dict containing a 'handler' reference to an instance of [WebSocketHandler](http://www.tornadoweb.org/en/stable/websocket.html#tornado.websocket.WebSocketHandler) - in short-hand: ```python ws_clients = [ {...
It sounds like the server wasn't actually able to send all that data to the client, so most of what you sent was queued up in the server process memory....
I don't think that code will ever call `send_message()` because the only caller is: ``` @profile def doWithData(self, type): cls = self.__class__ count=0 while(True): count=count+1 if cls.clients_connected!=0 and count==30: count=0...
Python is able to count up to 30 in a fraction of a millisecond. That loop is calling `send_message()` basically as fast as it can, and never giving any time...
For python2.7 you can translate my example code by replacing `async` and `await` with `@coroutine` and `yield` respectively
With the above code, using python 2.7.15 and tornado 5.1.1, I get a constant 19 MiB of RSS memory usage. I connect one websocket client, send one message, get a...
You may be confused by the memory profiler: some memory is allocated during each `send_message()`, but should be freed after the ioloop is able to complete the send, which happens...
I think this will need to be avoided on windows where setsid() is not available.
I'm now thinking that maybe this should be optional anyway, maybe not all ProxyCommands should use `setsid()`. Also, since Python-3.2: > if start_new_session is true the setsid() system call will...