Skip to main content

A minimalistic asyncio event loop based on the GLib main event loop

Project description

gasyncio - A minimalistic asyncio event loop based on the GLib main event loop

So far only a proof-of-concept.

Defines GAsyncIOEventLoopPolicy and GAsyncIOEventLoop.

Use loop.run_application(app, argv) to run Gio.Application. While the application is running, the asyncio event loop will function normally, run by the GLib main event loop.

Use loop.run_without_glib_until_complete(future) for cleanup.

The following should be semantically equivalent:

policy = asyncio.set_event_loop_policy(gasyncio.GAsyncIOEventLoopPolicy())
loop = asyncio.get_event_loop()
loop.start_slave_loop()
App().run(sys.argv)
loop.stop_slave_loop()
loop.close()
asyncio.set_event_loop_policy(policy)
del loop, policy
loop = gasyncio.GAsyncIOEventLoop()
loop.start_slave_loop()
App().run(sys.argv)
loop.stop_slave_loop()
loop.close()
del loop
gasyncio.GAsyncIOEventLoop().run(App(), sys.argv)

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

gasyncio-0.0.1.tar.gz (3.7 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: gasyncio-0.0.1.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2

File hashes

Hashes for gasyncio-0.0.1.tar.gz
Algorithm Hash digest
SHA256 e591dafe558d1e2e0be5504b84a9d410a8c3372a7686a83655006bc0b428d1f2
MD5 c4a2f2afe69d2ec23deca3a7b665ed0d
BLAKE2b-256 7389f7cbc9f885d385cff28f9ec45534f7075d6bcaa2c3e0b4a11d6a1490ab74

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