Skip to main content

type safety for synchronous concurrent task

Project description

ruff mypy

Downloads Downloads Downloads

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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

syncio-0.0.3-py2.py3-none-any.whl (3.9 kB view details)

Uploaded Python 2Python 3

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

Hashes for syncio-0.0.3.tar.gz
Algorithm Hash digest
SHA256 fcfc06d0138f1c5e4ab96b668966e32bf2ab2f84731d8a5f30518615f494a17e
MD5 7a3f9ac7040747c5e6658d588e4382c0
BLAKE2b-256 266af747ed5049dd4bb0b63ecb718a756202b746ce099a8acc90d7e48ed3bc98

See more details on using hashes here.

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

Hashes for syncio-0.0.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 da06195a57b362b2a6dc8e9a90632d5be19b131a0608dfe2fb38b1f7f410c73d
MD5 119b86fc9102f92d799a8523a6407947
BLAKE2b-256 45ec224762798a185d1a94468f61be262e141f65664adb14b36dc3e115fe09c4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page