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 details)
Built Distribution
File details
Details for the file deferred_result-0.1.1.tar.gz
.
File metadata
- Download URL: deferred_result-0.1.1.tar.gz
- Upload date:
- Size: 2.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4d222c63fc23df8d38a9a1fa3a9fae03753a80a5c1bf50e31974aca9d761aec |
|
MD5 | d3811ddf8ba31def895bd53eb2fbabfd |
|
BLAKE2b-256 | 4215f623edf0db3454d5e91b4a05c88d6ee8396029949e3c4482c4ab6d1440f4 |
File details
Details for the file deferred_result-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: deferred_result-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ffd5e9daa6ba27cbbcb7cb07aea63a83ca85a1fbf4671b0265a6177489a3c54 |
|
MD5 | 4dc0dd56b3b9ecaf001fbdcd20f1ba75 |
|
BLAKE2b-256 | 80d1d87786c76f238f5603d8515e7ad3131d48588ba4adb34ea55a7f7ebca66c |