-
Notifications
You must be signed in to change notification settings - Fork 76
Open
Description
Constructor of msgpackrpc.Session class has an optional argument loop=None. When loop is not specified, new Loop will be automatically created in the constructor.
However, as automatically-created Loops are not closed automatically, it uses more file descriptors than expected. This becomes an issue for clients that connects/disconnects frequently.
I think automatically-created Loops should be closed (i.e., session._loop._ioloop.close()) when its associated Session is closed.
I have two ideas:
- If
Loopinstance is not specified by user (i.e., automatically created inSessionconstructor), close the Loop whensession.close()method is called. - Add
close_loop=Trueto theSessionconstructor argument. Close the Loop only ifclose_loopis set to True whensession.close()method is called. This behavior is similar to closefd option of io.FileIO.
In addition, it is better to add close() method to msgpackrpc.Loop class, to allow users to close the internal tornado IOLoop.
wosiu
Metadata
Metadata
Assignees
Labels
No labels