Maybe the following can be made to work? Use two threads, each with an event loop. One thread uses a SelectorEventLoop, the other uses a ProactorEventLoop. Callbacks and coroutines running in these threads threads should communicate using call_soon_threadsafe(). (I suppose very brief periods of locking to update or access shared variables would also be okay, as long as no I/O is ever done while holding the lock.)
On Wed, Sep 24, 2014 at 8:47 AM, Andrew Svetlov <[email protected]> wrote: > Hi. I'm author of aiozmq. > > The library has very limited Windows support (Windows is a > second-class citizen in 0MQ world btw). > It cannot work with ProactorEventLoop and there is no way to solve the > issue due 0MQ API limitations. > > Old-style ZmqEventLoop (with ZmqEventLoopPolicy) can be used as > replacement for _WindowSelectorEventLoop with ZeroMQ socket support. > > Say again, the problem not in missing add_reader/add_writer but in 0MQ > library implementation details. > > On Wed, Sep 24, 2014 at 5:57 PM, Guido van Rossum <[email protected]> > wrote: > > I don't know much about the Windows primitives used by Proactor -- the > best > > I can recommend is that you try to figure out how to do this by studying > the > > source and experimenting, and then suggest a patch. > > > > On Tue, Sep 23, 2014 at 11:51 PM, Arve Knudsen <[email protected]> > > wrote: > >> > >> Hi guys > >> > >> Is there some way to work around the missing support for > >> add_reader/add_writer in asyncio.ProactorEventLoop? Specifically, I'm > trying > >> to use a library (aiozmq) that detects when it's able to read from > sockets > >> (via add_reader) and to write to sockets (via add_writer), and I would > like > >> to combine it with ProactorEventLoop. > >> > >> Thanks, > >> Arve > > > > > > > > > > -- > > --Guido van Rossum (python.org/~guido) > > > > -- > Thanks, > Andrew Svetlov > -- --Guido van Rossum (python.org/~guido)
