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.1.tar.gz
(2.2 kB
view hashes)
Built Distribution
Close
Hashes for deferred_result-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ffd5e9daa6ba27cbbcb7cb07aea63a83ca85a1fbf4671b0265a6177489a3c54 |
|
MD5 | 4dc0dd56b3b9ecaf001fbdcd20f1ba75 |
|
BLAKE2b-256 | 80d1d87786c76f238f5603d8515e7ad3131d48588ba4adb34ea55a7f7ebca66c |