Simple DeferredResult
Project description
DeferredResult
This library provides simple deferred result.
Usage
Create deferred result:
def_result = DeferredResult[str]()
Then you can wait for the result using optional timeout:
result = def_result.wait(timeout=1)
While waiting for result other thread can set result:
def_result.resolve('Hello World')
After resolving result all threads waiting for result will be resumed.
It is also possible to reject deferred result:
def_result.reject(RuntimeError('Well....'))
In that case all threads waiting for result will be resumed and exception passed to reject
will be thrown.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
deferred_result-0.1.0.tar.gz
(2.2 kB
view hashes)