v3.4.x get_running_loop break django-channels runworker
See original GitHub issueget_running_loop raise RuntimeError with any django-channels runworker command because there is no running event loop…
patch?
diff --git a/asgiref/server.py b/asgiref/server.py
index fb1c394..d1d27f4 100644
--- a/asgiref/server.py
+++ b/asgiref/server.py
@@ -56,8 +56,8 @@ class StatelessServer:
"""
Runs the asyncio event loop with our handler loop.
"""
- event_loop = get_running_loop()
- asyncio.ensure_future(self.application_checker())
+ event_loop = asyncio.get_event_loop()
+ asyncio.ensure_future(self.application_checker(), loop=event_loop)
try:
event_loop.run_until_complete(self.handle())
except KeyboardInterrupt:
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:15 (11 by maintainers)
Top Results From Across the Web
Worker and Background Tasks - Django Channels
The worker/background tasks system in Channels is simple and very fast, and achieves this by not having some features you may find useful,...
Read more >RuntimeError: no running event loop Djnago runworker
I am deploying my Django app on AWS Ec2 with Apache. I have Asgi and WSGI. I wanna run:
Read more >Event Loop — Python 3.11.1 documentation
The event loop is the core of every asyncio application. Event loops run asynchronous tasks and callbacks, perform network IO operations, and run...
Read more >Hacking Django Channels for Fun (and Profit) - Six Feet Up
3 (as of March 2021). The channels package supports a lightweight message passing system (called a channel layer), which allows messages to be ......
Read more >Getting Started with Django Channels - Real Python
Redis (v3.2.8). Objectives. By the end of this tutorial, you will be able to… Add Web sockets support to a Django ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have the same problem in https://github.com/django/channels/issues/1713.
Tested with python 3.8.4 and python 3.10.0 (3.10.0a5)
no problems when
asgiref==3.3.4
is installed@bj00rn no. Let’s close it here though it’s a channels issue.