The ability to close cached connections is needed in order to have a clean
reactor when the program ends.
policy = get_compatible_ssl_context_factory(cert_file)
+ self._pool = pool
self._agent = Agent(
reactor,
policy,
d.addCallback(readBody)
return d
+ def close(self):
+ """
+ Close any cached connections.
+ """
+ self._pool.closeCachedConnections()
+
class StringBodyProducer(object):
"""
A producer that writes the body of a request to a consumer.