-
Notifications
You must be signed in to change notification settings - Fork 648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using zmq.asyncio, getting NotImplementedError when creating a REQ socket #1521
Comments
I ran into the same issue on Win10 using Python 3.8+ and the reason seems to be the default asyncio event loop policy changed for the Windows platform. Manually changing it to the supported one resolved the issue for me. Therefore I just added: if sys.platform == 'win32':
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) after the asyncio imports (wrapped into this if block to keep things platform independent) |
pyzmq doesn't support the proactor event loop? OK. Thanks for the work-around. |
No, pyzmq can't support proactor because asyncio decided to exclude FD support from their proactor implementation, and libzmq's FD support is (mostly) incompatible with IOCP. Tornado 6.1 has a decent workaround, but frustrating that it's still required (and there are some performance costs associated with using threads). Until that's addressed, either in libzmq or in asyncio, libzmq (not really up to pyzmq) is incompatible with ProactorEventLoop, as far as I can tell. The only way for pyzmq to take responsibility for supporting proactor itself, would be to duplicate tornado's threads workaround to not actually use Proactor and use select in a separate thread to wake proactor in the main thread. |
Please add the workaround to your examples and documentation. |
Had a simple REQ-REP application working fine. I went to convert the python client code to asyncio and ran into a NotImplemented error.
I tried to find it. Does this mean that AbstractEventLoop virtual methods are getting called?
pyzmq 22.0.3
python 3.9
win10
Traceback
minimal_example.py
The text was updated successfully, but these errors were encountered: