Skip to main content

Convert python async function to a sync function for calling from a normal function in an existing event loop

Project description

a2s

Python async function to sync function, Convert python async function to a sync function for calling from a normal function in an existing event loop

Usage

import asyncio
from src.a2s import sync


@sync
async def an_async_func():
    print("Hello World")


def a_sync_func():
    an_async_func()
    pass


async def main():
    a_sync_func()
    pass


if __name__ == '__main__':
    asyncio.run(main())

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

a2s-1.0.0.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

a2s-1.0.0-py3-none-any.whl (2.4 kB view details)

Uploaded Python 3

File details

Details for the file a2s-1.0.0.tar.gz.

File metadata

  • Download URL: a2s-1.0.0.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10

File hashes

Hashes for a2s-1.0.0.tar.gz
Algorithm Hash digest
SHA256 90f9d6b5bd000d23be4504c3c4fd19fbfa050fa807194932385f8f0930db3240
MD5 9f5013185aaa3df63017edc6bd6eaf77
BLAKE2b-256 3878e4186eff0270f4e2360dc40bdaefbe05e2bfebf1bd15e348a1862751503d

See more details on using hashes here.

File details

Details for the file a2s-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: a2s-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 2.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10

File hashes

Hashes for a2s-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 29ffcb9b407fab5b3ee0dc3e2a85b728d814e52695e37bb7dc298b2e90a36ec9
MD5 0b9b462aeb3d9fdcba06989b44ab912f
BLAKE2b-256 7edef405f085d88c3053c8c755ff004859dc440e5e368f904c126a647512a8e8

See more details on using hashes here.

Supported by

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