Source Package: python-unsync (1.4.0-1.6)
Unsynchronize asyncio
Unsynchronize `asyncio` by using an ambient event loop in a separate thread. 1. Mark all async functions with `@unsync`. May also mark regular functions to execute in a separate thread. * All `@unsync` functions, async or not, return an `Unfuture` 2. All `Futures` must be `Unfutures` which includes the result of an `@unsync` function call, or wrapping `Unfuture(asyncio.Future)` or `Unfuture(concurrent.Future)`. `Unfuture` combines the behavior of `asyncio.Future` and `concurrent.Future`: * `Unfuture.set_value` is threadsafe unlike `asyncio.Future` * `Unfuture` instances can be awaited, even if made from `concurrent.Future` * `Unfuture.result()` is a blocking operation *except* in `unsync.loop`/`unsync.thread` where it behaves like `asyncio.Future.result` and will throw an exception if the future is not done 3. Functions will execute in different contexts: * `@unsync` async functions will execute in an event loop in `unsync.thread` * `@unsync` regular functions will execute in `unsync.thread_executor`, a `ThreadPoolExecutor` * `@unsync(cpu_bound=True)` regular functions will execute in `unsync.process_executor`, a `ProcessPoolExecutor`
Package information
- Homepage
- [https://github.com/alex-sherman/unsync]
- License
- MIT
- Mantenedor do pacote downstream
- Desconhecido: não informado na fonte indexada
The following binary packages are built from this source package:
- python313-unsync
Unsynchronize asyncio
- python314-unsync
Unsynchronize asyncio
