Skip to main content

unblock comes with utilities that can be used to convert synchronous functions to async for use in event loop

Project description

unblock

unblock comes with utilities that can be used to convert synchronous functions to async for use in event loop. For documentation, refer here

Here is a quick example,

import asyncio
from unblock import asyncify
   
@asyncify
def my_sync_func():
   #do something

if __name__ == "__main__":
   asyncio.run(my_sync_func())

Release Notes:

0.0.1

Features,

  • Convert your synchronous functions, methods etc. to asynchronous with easy to use constructs
  • Asynchronous tasks are started in the background without the need of await keyword. Note that await is still needed to fetch results
  • By default uses even loop provided by asyncio. But supports other event loops as well
  • Support for ThreadPool or ProcessPool executors
  • Comes with APIs to build your own asynchronous context manager, asynchronous iterators etc.
  • Supports python 3.7 and above

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

get_unblock-0.0.1.tar.gz (38.4 kB view hashes)

Uploaded Source

Built Distribution

get_unblock-0.0.1-py3-none-any.whl (13.5 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