Skip to main content

Synchronus Wrapper for Async Code

Project description

Run fast asynchronous code from a synchronous code. Async Services provide a synchronous wrapper to run third party asynchronous code or any coroutine for that matter in a synchronous way from a synchronous code.

Installation :

pip install async_services

Example Usage: from async_services.core import run_coro

async def coroutine(seconds=1, raise_exception=False): await asyncio.sleep(seconds) if raise_exception: raise Exception("Sample Exception") return "Hello World"

result = run_coro(coroutine(), block=True) print(result) assert result[0] == CoroStatus.Completed assert result[1] == "Hello World"

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

async_services-1.0.0.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distribution

async_services-1.0.0-py3-none-any.whl (4.7 kB view hashes)

Uploaded Python 3

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