An async, (hopefully soon fully) concurrent.futures.Executor compliant, android compatible process pool implementation
Project description
aio_process_pool
Tihs pacakage provides an async, (hopefully soon fully) concurrent.futures.Executor compliant, android compatible process pool.
Table of Contents
Installation
pip install aio_process_pool
Usage
from aio_process_pool import AsyncProcessPool
def foo(x):
return x
# Note:
# - the process pool must be initialize AFTER all functions that are supposed
# to be called are defined
# - it's not save to initialize a process pool from a multithreaded process
# because it's based on `os.fork` / `multiprocessing.Process`
pool = AsyncProcessPool()
async def using_run():
return await pool.run(foo, 72)
async def using_executor():
from functools import partial
loop = asyncio.get_event_loop()
return await loop.run_in_executor(pool, partial(foo, 74))
License
aio_process_pool is distributed under the terms of the MIT license.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aio_process_pool-0.0.3.tar.gz.
File metadata
- Download URL: aio_process_pool-0.0.3.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef264be4c423d98b8eff2499092912e9a84b7ef0c5043805a4a0a65a310442fd
|
|
| MD5 |
5ac9ebf1b1d964bccff5648acfe6f41f
|
|
| BLAKE2b-256 |
597cc1b5addd8fba93739333c7252242a7713734d689082e6475ac4cfb6d501c
|
File details
Details for the file aio_process_pool-0.0.3-py3-none-any.whl.
File metadata
- Download URL: aio_process_pool-0.0.3-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1fc96e90d64ac46dd5c8576f32dc0eca5a064622018b53ff3160cd329ad72fdb
|
|
| MD5 |
e1dbbee444fa4ee2aca84f5a9f7606d9
|
|
| BLAKE2b-256 |
9d86254f1fc5d55a4e9c2772897cad80164a64c72cb40826f74e3a5ca19e90b7
|