won't cause an exception after the client is closed.
instance._events = {}
instance._added_perform_callback = False
instance._timeout = None
+ instance._closed = False
cls._ASYNC_CLIENTS[io_loop] = instance
return instance
for curl in self._curls:
curl.close()
self._multi.close()
+ self._closed = True
def fetch(self, request, callback, **kwargs):
"""Executes an HTTPRequest, calling callback with an HTTPResponse.
def _perform(self):
self._added_perform_callback = False
+ if self._closed:
+ return
+
while True:
while True:
ret, num_handles = self._multi.perform()