Skip to content
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

Client in Django #213

Open
kimi0421 opened this issue May 23, 2019 · 1 comment
Open

Client in Django #213

kimi0421 opened this issue May 23, 2019 · 1 comment
Labels
asyncblocked When blocking code is used within gevent

Comments

@kimi0421
Copy link

How can I use zerorpc client in Django? I put connection in django settings, and try to use the rpc connection in anywhere in Django project. However it always hangs, it shows the error:

File "/Users/kimi/how/env/athena/lib/python3.6/site-packages/zerorpc/events.py", line 136, in call
self._send_queue.put(parts, timeout=timeout)
File "src/gevent/queue.py", line 629, in gevent._queue.Channel.put
File "src/gevent/queue.py", line 624, in gevent._queue.Channel.put
File "src/gevent/_waiter.py", line 151, in gevent.__waiter.Waiter.get
File "src/gevent/_greenlet_primitives.py", line 61, in gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch
File "src/gevent/_greenlet_primitives.py", line 61, in gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch
File "src/gevent/_greenlet_primitives.py", line 65, in gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch
File "src/gevent/__greenlet_primitives.pxd", line 35, in gevent.__greenlet_primitives._greenlet_switch
gevent.exceptions.LoopExit: This operation would block forever
Hub: <Hub '' at 0x119ba7cc0 select pending=0 ref=0 thread_ident=0x700001482000>
Handles:
[]

@bombela bombela added the asyncblocked When blocking code is used within gevent label Mar 24, 2023
@bombela
Copy link
Member

bombela commented Mar 24, 2023

Django is blocking, gevent is async. They won't play nice together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
asyncblocked When blocking code is used within gevent
Projects
None yet
Development

No branches or pull requests

2 participants