Skip to content

Support different async libraries and frameworks #82

@tmontes

Description

@tmontes

Facts

  • Current work is bound to Standard Library's asyncio.
  • It depends on asyncio.sleep and on the asyncio.CancelledError exception.
  • WRT asyncio, the syncer module transforms asyncio.sleep to time.sleep.

Idea

  • Supporting other libraries and frameworks would be nice: curio, trio, and Twisted come to mind.
  • Maybe having a decoupling module that would map sleep and task cancellation to the various candidates above could work. Such mapping could be done automatically by trying to import them (and prioritising if more than one is found), falling back to asyncio. Manual selection should be possible.
  • The syncer module would need minor and trivial changes, it seems.
  • Sleeping is nearly trivial, even in Twisted, that would require a minimal sleep implementation to be provided.
  • Need to confirm task cancellation model under different targets: do they all throw exceptions into the underlying coroutine?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions