Utility functions for asyncio which Stephan wished where in the stdlib but aren't.
Project description
akitchensyncio
==============
Utility functions for asyncio which Stephan wished where in the stdlib
but aren't.
wrap_future(f)
--------------
Takes a callable f which returns an awaitable, and returns a callable
which wraps the awaitable in asyncio.ensure_future.
Can also be used as a decorator, especially with coroutine functions:
@wrap_future
async def foo(arg1, arg2):
...
transform_future(f, awaitable)
------------------------------
Apply a function to the result of an awaitable, return a future which
delivers the result.
iawait(awaitable)
-----------------
"Interactive await" -- Run default eventloop until awaitable has
completed. Mainly useful for interactive experimentation.
==============
Utility functions for asyncio which Stephan wished where in the stdlib
but aren't.
wrap_future(f)
--------------
Takes a callable f which returns an awaitable, and returns a callable
which wraps the awaitable in asyncio.ensure_future.
Can also be used as a decorator, especially with coroutine functions:
@wrap_future
async def foo(arg1, arg2):
...
transform_future(f, awaitable)
------------------------------
Apply a function to the result of an awaitable, return a future which
delivers the result.
iawait(awaitable)
-----------------
"Interactive await" -- Run default eventloop until awaitable has
completed. Mainly useful for interactive experimentation.
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
akitchensyncio-0.1.0.tar.gz
(3.0 kB
view hashes)
Built Distribution
Close
Hashes for akitchensyncio-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e803c73ecbb7c77a02cdca6a1adf186ac4692de702993f65254243c370e2b73 |
|
MD5 | 9505168291191605e85a8dae8c673f86 |
|
BLAKE2b-256 | 03233ac87c0537499641a51bbca888d907bd8fbe745ab624e7c1376e4fe72487 |