woob.core.bcall

class BackendsCall(backends, function, *args, **kwargs)[source]

Bases: object

store_result(backend, result)[source]

Store the result when a backend task finished.

backend_process(function, args, kwargs)[source]

Internal method to run a method of a backend.

As this method may be blocking, it should be run on its own thread.

callback_thread(callback, errback=None, finishback=None)[source]

Call this method to create a thread which will callback a specified function everytimes a new result comes.

When the process is over, the function will be called with both arguments set to None.

The functions prototypes:

def callback(result) def errback(backend, error, backtrace) def finishback()

wait()[source]

Wait until all tasks are finished.

stop(wait=False)[source]

Stop all tasks.

Parameters:

wait (bool) – If True, wait until all tasks stopped. (default: False)

exception CallErrors(errors)[source]

Bases: Exception