class woob.browser.sessions.FuturesSession(executor=None, max_workers=2, max_retries=2, *args, **kwargs)

Bases: woob.browser.sessions.WoobSession

Creates a FuturesSession

  • ProcessPoolExecutor is not supported b/c Response objects are not picklable.

  • If you provide both executor and max_workers, the latter is ignored and provided executor is used as is.


Closes all adapters and as such the session

send(*args, **kwargs)

Maintains the existing api for Session.send()

Used by request() and thus all of the higher level methods

If the is_async param is True, the request is processed in a thread. Otherwise, the request is processed as usual, in a blocking way.

In all cases, it will call the callback parameter and return its result when the request has been processed.


alias of woob.browser.sessions.WoobSession

class woob.browser.sessions.WoobSession

Bases: requests.sessions.Session


Constructs a PreparedRequest for transmission and returns it. The PreparedRequest has settings merged from the Request instance and those of the Session.


requestRequest instance to prepare with this session’s settings.

woob.browser.sessions.merge_hooks(request_hooks, session_hooks, dict_class=<class 'collections.OrderedDict'>)

Properly merges both requests and session hooks.

This is necessary because when request_hooks == {‘response’: []}, the merge breaks Session hooks entirely.

Backport from request so we can use it in wheezy