You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
Facts
asyncio.asyncio.sleepand on theasyncio.CancelledErrorexception.asyncio, thesyncermodule transformsasyncio.sleeptotime.sleep.Idea
sleepand 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 toasyncio. Manual selection should be possible.syncermodule would need minor and trivial changes, it seems.sleepimplementation to be provided.