How to use the treq.api.UNIXCapableAgent function in treq

To help you get started, we’ve selected a few treq examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ClusterHQ / powerstrip-flocker / treq / api.py View on Github external
def _client(*args, **kwargs):
    reactor = default_reactor(kwargs.get('reactor'))
    #pool = default_pool(reactor,
    #                    kwargs.get('pool'),
    #                    kwargs.get('persistent'))

    # XXX setting pool to None is necessary to stop weird bug where deferreds
    # never fire on requests after chunked requests.
    pool = None
    agent = UNIXCapableAgent(reactor, pool=pool)
    return HTTPClient(agent)