Hello, On Wed, 6 May 2015 09:27:16 +0100 Paul Moore <p.f.mo...@gmail.com> wrote:
> On 6 May 2015 at 07:46, Greg Ewing <greg.ew...@canterbury.ac.nz> > wrote: > > Another problem with the "core" idea is that > > you can't start with an event loop that "just does > > scheduling" and then add on other features such > > as I/O *from the outside*. There has to be some > > point at which everything comes together, which > > means choosing something like select() or > > poll() or I/O completion queues, and build that > > into the heart of your event loop. At that point > > it's no longer something with a simple core. [] > So, to some extent (how far is something I'd need to code up a loop to > confirm) you can build the Futures and synchronisation mechanisms with > an event loop that supports only this "minimal interface". > > Essentially, that's my goal - to allow people who want to write (say) > a Windows GUI event loop, or a Windows event loop based of > WaitForXXXObject, or a Tkinter loop, or whatever, to *not* have to > write their own implementation of synchronisation or future objects. > > That may mean lifting the asyncio code and putting it into a separate > library, to make the separation between "asyncio-dependent" and > "general async" clearer. Or if asyncio's provisional status doesn't > last long enough to do that, we may end up with an asyncio > implementation and a separate (possibly 3rd party) "general" > implementation. MicroPython has alternative implementation of asyncio subset. It's structured as a generic scheduler component "uasyncio.core" https://github.com/micropython/micropython-lib/blob/master/uasyncio.core/uasyncio/core.py (170 total lines) and "uasyncio" which adds I/O scheduling on top of it: https://github.com/micropython/micropython-lib/blob/master/uasyncio/uasyncio/__init__.py "uasyncio.core" can be used separately, and is intended for usage as such on e.g. microcontrollers. It's built around native Python concept of coroutines (plus callbacks). It doesn't include concept of futures. They can be added as an extension built on top, but so far I didn't see need for that, while having developed a web picoframework for uasyncio (https://github.com/pfalcon/picoweb) -- Best regards, Paul mailto:pmis...@gmail.com _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com