type safety for synchronous concurrent task
Project description
Syncio is inspired by asyncio. you can easy to create task and gather with syncio.gather() (multiprocessing) or syncio.thread_gather() (threading).
Example
from syncio import create_task, gather
def hello(n: int) -> str:
return f"hello {n + 1}"
tasks = [create_task(hello)(i) for i in range(3)]
results = gather(*tasks)
print("output task_1:", results["task_1"])
print("output task_2:", results["task_2"])
print("output task_3:", results["task_3"])
# or using iterator
for result in results:
print(result)
author: guangrei.
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
syncio-0.0.3.tar.gz
(2.9 kB
view details)
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 syncio-0.0.3.tar.gz.
File metadata
- Download URL: syncio-0.0.3.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fcfc06d0138f1c5e4ab96b668966e32bf2ab2f84731d8a5f30518615f494a17e
|
|
| MD5 |
7a3f9ac7040747c5e6658d588e4382c0
|
|
| BLAKE2b-256 |
266af747ed5049dd4bb0b63ecb718a756202b746ce099a8acc90d7e48ed3bc98
|
File details
Details for the file syncio-0.0.3-py2.py3-none-any.whl.
File metadata
- Download URL: syncio-0.0.3-py2.py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da06195a57b362b2a6dc8e9a90632d5be19b131a0608dfe2fb38b1f7f410c73d
|
|
| MD5 |
119b86fc9102f92d799a8523a6407947
|
|
| BLAKE2b-256 |
45ec224762798a185d1a94468f61be262e141f65664adb14b36dc3e115fe09c4
|