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.4.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.4.tar.gz.
File metadata
- Download URL: syncio-0.0.4.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 |
853e422e30669e0f82ba02ebdb8905e932e50fe59414ec2e015e9568bc752d8f
|
|
| MD5 |
fe50d81ed5f99bc78c06e43469dbbcce
|
|
| BLAKE2b-256 |
ad37abe579268da27d827c4e7bd35413eb7fafdb81579bfb0e00e9d7ef4bc11d
|
File details
Details for the file syncio-0.0.4-py2.py3-none-any.whl.
File metadata
- Download URL: syncio-0.0.4-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 |
be6bd5fb07d998bd9f46da92f921d7adb9e4769052f9d1c6501c6f0d93718b11
|
|
| MD5 |
817ac5f0dd63e98f6425eda9c9536922
|
|
| BLAKE2b-256 |
8ab9b31a4c0f32957f5f585ab1894727c96c078493c6bb3917b49addbba4ab2f
|