Skip to main content

type safe for synchronous python concurrently

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.1.tar.gz (2.5 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.1-py2.py3-none-any.whl (3.4 kB view details)

Uploaded Python 2Python 3

File details

Details for the file syncio-0.0.1.tar.gz.

File metadata

  • Download URL: syncio-0.0.1.tar.gz
  • Upload date:
  • Size: 2.5 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.1.tar.gz
Algorithm Hash digest
SHA256 07c16c1604d8be123d1d6ee944a87a92d52dde59b22242c6dc94a143621f7a64
MD5 f6e900d569532425baa8b465eba3452a
BLAKE2b-256 76a45ede7085b87bb98128ec33807fa9b124062cf17a0b093ce8f013eb328f34

See more details on using hashes here.

File details

Details for the file syncio-0.0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: syncio-0.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 3.4 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.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e22ff595aa641d1ff3280ca5982dc43ad938b7b3ff4460a2745ed66e0f06adf8
MD5 c4a5479ba353cd2c038bce1e2282048b
BLAKE2b-256 86b4086567e9dde28dfc837d1a3f9cfe06de73076055f74badc0e7d5bf0942a2

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