# On an issue between consumer and worker

**URL:** <https://forum.djangoproject.com/t/on-an-issue-between-consumer-and-worker/44523>\
**Category:** Async/Channels\
**Created:** [March 16, 2026, 1:41am UTC](https://forum.djangoproject.com/t/on-an-issue-between-consumer-and-worker/44523 "2026-03-16T01:41:48Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![brian-ketelboeter](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/brian-ketelboeter/32/30559_2.png) [@brian-ketelboeter](https://forum.djangoproject.com/u/brian-ketelboeter)\
**Post date:** [March 16, 2026, 1:41am UTC](https://forum.djangoproject.com/t/on-an-issue-between-consumer-and-worker/44523/1 "2026-03-16T01:41:48Z")

</div>

My question is a follow-up to

[https://forum.djangoproject.com/t/using-background-tasks-in-django-but-how-exactly/28019/5](https://forum.djangoproject.com/t/using-background-tasks-in-django-but-how-exactly/28019/5)[https://forum.djangoproject.com/t/using-background-tasks-in-django-but-how-exactly/28019](https://forum.djangoproject.com/t/using-background-tasks-in-django-but-how-exactly/28019)

and, in particular, the part where the questioner attempts to have a consumer send a message to a worker, there called NodeManagerConsumer, in the django notes

[https://channels.readthedocs.io/en/latest/topics/worker.html#worker-and-background-tasks](https://channels.readthedocs.io/en/latest/topics/worker.html#worker-and-background-tasks)

it is the PrintConsumer.

I am working on a game that will run on Django and will have a log-in page, a lobby for chatting and challenging other players which will lead to a private game room where the game will take place. As I am a novice programmer, this project is entirely for learning processes only. So please go gentle on me.

Based on my readings, I believe a lot of the processes of the actual game are best run using workers so I decided to practice making a simple ‘PrintConsumer’ worker to a consumer called PlayerConsumer. On its own (without the PrintConsumer), the PlayerConsumer seems to run fine and does everything else I ask it.

---

<div class="post-metadata">

**Author:** ![brian-ketelboeter](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/brian-ketelboeter/32/30559_2.png) [@brian-ketelboeter](https://forum.djangoproject.com/u/brian-ketelboeter)\
**Post date:** [March 16, 2026, 1:44am UTC](https://forum.djangoproject.com/t/on-an-issue-between-consumer-and-worker/44523/2 "2026-03-16T01:44:39Z")

</div>

This is a work in progress: I thought I could start the question and save it to work on later but the editor did not have a save option. I know I need to add more but will continue it tomorrow. Sorry if you read through what I have so far.

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [March 16, 2026, 2:04am UTC](https://forum.djangoproject.com/t/on-an-issue-between-consumer-and-worker/44523/3 "2026-03-16T02:04:57Z")

</div>

This is precisely the architecture that I’m using for my game engine.

I have an AsyncJsonWebsocketConsumer that handles all the interactions between the browser and the server.

Each Game Title in my system is run by a worker process for that game. (With 5 active games, that’s 5 separate worker processes.)

Each consumer is a SyncConsumer.

Architecturally, the “Lobby” is just another “Game”.

This all works _extremely_ well. It’s been in active use for about 4 years, and I’m working on it consistently now.

> [@brian-ketelboeter](#):
>
> attempts to have a consumer send a message to a worker

Sending a message between consumers (a worker process is just another type of consumer) is a matter of using the `send` method, with the routing information of the target consumer being the specified destination for the message.

See the docs for [Sending](https://channels.readthedocs.io/en/latest/topics/worker.html#sending) - it really is that easy.

Feel free to ask questions here! We’re here to help.

---

<div class="post-metadata">

**Author:** ![brian-ketelboeter](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/brian-ketelboeter/32/30559_2.png) [@brian-ketelboeter](https://forum.djangoproject.com/u/brian-ketelboeter)\
**Post date:** [March 16, 2026, 2:18am UTC](https://forum.djangoproject.com/t/on-an-issue-between-consumer-and-worker/44523/4 "2026-03-16T02:18:09Z")

</div>

I read through some of your other posts on consumer/workers and that was what lead me to the idea of using them but even working with consumers and websockets is new to me so it has taken quite awhile.

As I mentioned in the closed question, I followed what the two of you were discussing. I tried that trick where one can separate the consumer from the websocket and sent the message in the django shell, nothing happened in the terminal running the worker which (as you mentioned) indicated there was a problem with the connection.

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [March 16, 2026, 2:23am UTC](https://forum.djangoproject.com/t/on-an-issue-between-consumer-and-worker/44523/5 "2026-03-16T02:23:20Z")

</div>

If you want assistance with that, you’re going to need to post the code for your consumer, your routing configuration, and the commands you’re issuing in the shell to send the message, along with the message you’re trying to send.

If you’re getting any error messages in either console, please post them.

It would also be helpful to see the command you’re using to run the worker and the shell, along with your INSTALLED\_APPS and CHANNEL\_LAYERS settings.

(Please remember to post your code between lines of three backticks - ` for each file, and to identify the name of the file containing the code you’re posting.)

---

<div class="post-metadata">

**Author:** ![brian-ketelboeter](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/brian-ketelboeter/32/30559_2.png) [@brian-ketelboeter](https://forum.djangoproject.com/u/brian-ketelboeter)\
**Post date:** [March 16, 2026, 2:34am UTC](https://forum.djangoproject.com/t/on-an-issue-between-consumer-and-worker/44523/6 "2026-03-16T02:34:00Z")

</div>

To keep things simple, I will post (what I believe to be) the important material. If there is anything else needed, I will add it. This is the lobby/consumers.py:

```auto
class PlayerConsumer(WebsocketConsumer):
	def __init__ (self,*args,**kwargs):
		super(). __init__ (*args, **kwargs)
		self.user = None
		self.user_inbox = None
		self.room_name="public"
		
		if self.groups is None:
			self.groups = []
		
		self.room_group_name = f"chat_{self.room_name}"
		
	def connect(self):
		self.user = self.scope['user']
		print(self.user)

		#self.room_group_name = f"chat_{self.room_name}"

		# Join room group
		async_to_sync(self.channel_layer.group_add)(
			self.room_group_name, self.channel_name
		)
		# Join private group
		async_to_sync(self.channel_layer.group_add)(
			f"user_{self.user.username}",self.channel_name
		)

		self.accept()
		
	def disconnect(self,close_code):
		pass
		"""
		if self.MyUser.is_authenticated:
			async_to_sync(self.channel_layer.group_discard)(
				self.user_inbox,
				self.channel_name,
			)
		"""
	def receive(self,text_data):
		text_data_json = json.loads(text_data)
		message = text_data_json["message"]
		
		#=None,bytes_data=None
		if message.startswith('win'):
			print(message)
			async_to_sync(self.channel_layer.send)(
				'print-consumer',{
					'type':'test',
					'text':message,
				}
			)
		elif message.startswith('/pm'):
			split = message.split(' ',2)
			target = split[1]
			target_msg = split[2]
			async_to_sync(self.channel_layer.group_send)(
				f'user_{target}',
				{'type':'private.message',
				'sender': self.user.username,
				'message':target_msg,
				}
			)
			self.send(json.dumps({
				'type':'private message delivered',
				'target': target,
				'message': target_msg,
			}))
		else:
			async_to_sync(self.channel_layer.group_send)(
			self.room_group_name,{"type":"chat.message",
			'sender': self.user.username,
			"message": message}
			)
				
		return

	def chat_message(self,event):
		message = f"(public message from "+event['sender']+') '+event["message"]
		self.send(json.dumps({'message':message}))
		
	def private_message(self,event):
		message = event['message']
		message ="(private message from "+event['sender']+') '+message
		self.send(json.dumps({'message':message}))
		

	def start_game(self,event):
		pass

	def join_game(self):
		pass

class PrintConsumer(SyncConsumer):
	print("Worker here!")
	def test(self,message):
		print("Test test!")
		print(f"I send you the message "+message['text'],flush=True)
 

```

I will post follow-up code, but it might be easier if I do it in separate comments.

I must go so I will continue this tomorrow.

---

<div class="post-metadata">

**Author:** ![brian-ketelboeter](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/brian-ketelboeter/32/30559_2.png) [@brian-ketelboeter](https://forum.djangoproject.com/u/brian-ketelboeter)\
**Post date:** [March 16, 2026, 6:57pm UTC](https://forum.djangoproject.com/t/on-an-issue-between-consumer-and-worker/44523/7 "2026-03-16T18:57:42Z")

</div>

From roshamo/asgi

````auto
import os
from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter,ChannelNameRouter
from channels.security.websocket import AllowedHostsOriginValidator
from django.core.asgi import get_asgi_application
from lobby.routing import lobby_websocket_urlpatterns
from game.routing import game_websocket_urlpatterns
```
os.environ.setdefault(‘DJANGO_SETTINGS_MODULE’, ‘roshambo.settings’)

````

```auto
django_asgi_app = get_asgi_application()
from game.consumers import GameConsumer, GameManager
from lobby.consumers import PlayerConsumer,PrintConsumer

```

```auto
application = ProtocolTypeRouter({
“http”: django_asgi_app,
“websocket”: AllowedHostsOriginValidator(
AuthMiddlewareStack(URLRouter(lobby_websocket_urlpatterns +
game_websocket_urlpatterns))
),
“channel”: ChannelNameRouter({“print-consumer”:PrintConsumer.as_asgi()})
})

```

---

<div class="post-metadata">

**Author:** ![brian-ketelboeter](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/brian-ketelboeter/32/30559_2.png) [@brian-ketelboeter](https://forum.djangoproject.com/u/brian-ketelboeter)\
**Post date:** [March 16, 2026, 7:09pm UTC](https://forum.djangoproject.com/t/on-an-issue-between-consumer-and-worker/44523/8 "2026-03-16T19:09:47Z")

</div>

roshamo/settings

```auto
DEBUG = True
ALLOWED_HOSTS = ['127.0.0.1']
# Application definition
INSTALLED_APPS = [
    'accounts',
    'daphne',
    'channels',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'chat',
    'game',
    'lobby',
]
MIDDLEWARE = [
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',  
    'django.middleware.security.SecurityMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'roshambo.urls'
TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]
WSGI_APPLICATION = 'roshambo.wsgi.application'
ASGI_APPLICATION = "roshambo.asgi.application"
CHANNEL_LAYERS = {
    "default": {
        "BACKEND": "channels_redis.core.RedisChannelLayer",
        "CONFIG":
        {"hosts":[("127.0.0.1",6379)],
        },
    },
}
# Database
# https://docs.djangoproject.com/en/5.2/ref/settings/#databases
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': BASE_DIR / 'db.sqlite3',
    }
}
# Password validation
# https://docs.djangoproject.com/en/5.2/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
    },
]
#AUTH_USER_MODEL = "accounts.MyUser"
# Internationalization
# https://docs.djangoproject.com/en/5.2/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/5.2/howto/static-files/
STATIC_URL = 'static/'
# Default primary key field type
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
LOGIN_REDIRECT_URL = '/lobby/'

```

---

<div class="post-metadata">

**Author:** ![brian-ketelboeter](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/brian-ketelboeter/32/30559_2.png) [@brian-ketelboeter](https://forum.djangoproject.com/u/brian-ketelboeter)\
**Post date:** [March 16, 2026, 7:26pm UTC](https://forum.djangoproject.com/t/on-an-issue-between-consumer-and-worker/44523/9 "2026-03-16T19:26:11Z")

</div>

lobby/routing.py

```auto
from django.urls import re_path
from . import consumer
lobby_websocket_urlpatterns = [
	re_path(r"ws/lobby/public/", consumers.PlayerConsumer.as_asgi())]

```

---

<div class="post-metadata">

**Author:** ![brian-ketelboeter](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/brian-ketelboeter/32/30559_2.png) [@brian-ketelboeter](https://forum.djangoproject.com/u/brian-ketelboeter)\
**Post date:** [March 16, 2026, 7:41pm UTC](https://forum.djangoproject.com/t/on-an-issue-between-consumer-and-worker/44523/10 "2026-03-16T19:41:16Z")

</div>

The folder structure:

```auto
roshambo
   lobby
      consumers.py
      routing.py
   roshambo
      asgi.py
      settings.py
   manage.py

Ithink this is all.

```

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [March 16, 2026, 8:13pm UTC](https://forum.djangoproject.com/t/on-an-issue-between-consumer-and-worker/44523/11 "2026-03-16T20:13:51Z")

</div>

Close. I still need to see the commands you are issuing to run this - both the worker and your shell, along with the specific commands you are running in the shell to try it and the console logs.

---

<div class="post-metadata">

**Author:** ![brian-ketelboeter](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/brian-ketelboeter/32/30559_2.png) [@brian-ketelboeter](https://forum.djangoproject.com/u/brian-ketelboeter)\
**Post date:** [March 16, 2026, 9:15pm UTC](https://forum.djangoproject.com/t/on-an-issue-between-consumer-and-worker/44523/12 "2026-03-16T21:15:48Z")

</div>

To start the redis server:

```auto
$ docker run --rm -p 6379:6379 redis:7

```

to run the worker:

```auto
$ uv run manage.py runworker PrintConsume

In the django shell:
>>from channels.layers import get_channel_layer
>>from asgiref.sync import async_to_sync
>>channel_layer = get_channel_layer()
>>async_to_sync(channel_layer.send)('print-consumer',{'type':'test','message':'A message'})

As mentioned, the runworker command runs fine I just get no result in the terminal

```

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [March 16, 2026, 10:14pm UTC](https://forum.djangoproject.com/t/on-an-issue-between-consumer-and-worker/44523/13 "2026-03-16T22:14:17Z")

</div>

Please, copy/paste and post the actual output from your runworker and django shell sessions. Do not extract or summarize what’s being displayed.

---

<div class="post-metadata">

**Author:** ![brian-ketelboeter](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/brian-ketelboeter/32/30559_2.png) [@brian-ketelboeter](https://forum.djangoproject.com/u/brian-ketelboeter)\
**Post date:** [March 16, 2026, 10:55pm UTC](https://forum.djangoproject.com/t/on-an-issue-between-consumer-and-worker/44523/14 "2026-03-16T22:55:39Z")

</div>

This is all the worker terminal shows (lines 3-4 are deugging lines)

```auto
$ uv run manage.py runworker PrintConsumer
Running worker for channels ['PrintConsumer']
Worker here!
getting here is half the job

```

---

<div class="post-metadata">

**Author:** ![brian-ketelboeter](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/brian-ketelboeter/32/30559_2.png) [@brian-ketelboeter](https://forum.djangoproject.com/u/brian-ketelboeter)\
**Post date:** [March 16, 2026, 10:57pm UTC](https://forum.djangoproject.com/t/on-an-issue-between-consumer-and-worker/44523/15 "2026-03-16T22:57:37Z")

</div>

I posted exactly what happens in the the django shell. Nothing happens afterwards, just moves to a new line. No errors anywhere.

---

<div class="post-metadata">

**Author:** ![brian-ketelboeter](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/brian-ketelboeter/32/30559_2.png) [@brian-ketelboeter](https://forum.djangoproject.com/u/brian-ketelboeter)\
**Post date:** [March 16, 2026, 11:04pm UTC](https://forum.djangoproject.com/t/on-an-issue-between-consumer-and-worker/44523/16 "2026-03-16T23:04:56Z")

</div>

In another terminal, I tried to runserver. Nothing there either:

```auto
$uv run manage.py runserver
Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).
March 16, 2026 - 17:00:26
Django version 5.2.8, using settings 'roshambo.settings'
Starting ASGI/Daphne version 4.2.1 development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
Worker here!
getting here is half the job

```

Then nothing. Just normal crickets

---

<div class="post-metadata">

**Author:** ![brian-ketelboeter](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/brian-ketelboeter/32/30559_2.png) [@brian-ketelboeter](https://forum.djangoproject.com/u/brian-ketelboeter)\
**Post date:** [March 16, 2026, 11:22pm UTC](https://forum.djangoproject.com/t/on-an-issue-between-consumer-and-worker/44523/17 "2026-03-16T23:22:48Z")

</div>

I can log multiple players in. This is the result in server terminal:

```auto
$ uv run manage.py runserver
Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).
March 16, 2026 - 17:00:26
Django version 5.2.8, using settings 'roshambo.settings'
Starting ASGI/Daphne version 4.2.1 development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
Worker here!
getting here is half the job
HTTP GET /accounts/login/ 200 [2.83, 127.0.0.1:51062]
Not Found: /favicon.ico
HTTP GET /favicon.ico 404 [1.45, 127.0.0.1:51062]
HTTP POST /accounts/login/ 200 [5.42, 127.0.0.1:51062]
HTTP POST /accounts/login/ 200 [5.53, 127.0.0.1:51062]
HTTP POST /accounts/login/ 200 [7.13, 127.0.0.1:51062]
HTTP GET /accounts/login/ 200 [0.09, 127.0.0.1:51062]
HTTP POST /accounts/login/ 200 [6.13, 127.0.0.1:51062]
HTTP GET /accounts/login/ 200 [0.70, 127.0.0.1:51095]
Not Found: /favicon.ico
HTTP GET /favicon.ico 404 [0.29, 127.0.0.1:51095]
HTTP POST /accounts/login/ 200 [6.38, 127.0.0.1:51095]
HTTP POST /accounts/login/ 200 [6.74, 127.0.0.1:51159]
HTTP POST /accounts/login/ 200 [8.80, 127.0.0.1:51159]
HTTP GET /accounts/login/ 200 [0.08, 127.0.0.1:51662]
HTTP GET /accounts/login/ 200 [0.15, 127.0.0.1:51832]
Not Found: /favicon.ico
HTTP GET /favicon.ico 404 [0.26, 127.0.0.1:51832]
HTTP POST /accounts/login/ 302 [12.02, 127.0.0.1:51832]
3
frightfullyFrigid
<QuerySet [<User: jaden>, <User: daisyDuck>, <User: frightfullyFrigid>, <User: advil>, <User: brianketelboeter>]>
HTTP GET /lobby/ 200 [11.47, 127.0.0.1:51832]
HTTP GET /static/lobby/lobby.js 304 [0.07, 127.0.0.1:51832]
WebSocket HANDSHAKING /ws/lobby/public/ [127.0.0.1:51844]
frightfullyFrigid
WebSocket CONNECT /ws/lobby/public/ [127.0.0.1:51844]
HTTP POST /accounts/login/ 302 [10.75, 127.0.0.1:51855]
1
jaden
<QuerySet [<User: jaden>, <User: daisyDuck>, <User: frightfullyFrigid>, <User: advil>]>
HTTP GET /lobby/ 200 [0.65, 127.0.0.1:51855]
HTTP GET /static/lobby/lobby.js 304 [0.01, 127.0.0.1:51855]
WebSocket HANDSHAKING /ws/lobby/public/ [127.0.0.1:51858]
jaden
WebSocket CONNECT /ws/lobby/public/ [127.0.0.1:51858]

I had some issues logging in a couple times.

```

---

<div class="post-metadata">

**Author:** ![brian-ketelboeter](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/brian-ketelboeter/32/30559_2.png) [@brian-ketelboeter](https://forum.djangoproject.com/u/brian-ketelboeter)\
**Post date:** [March 17, 2026, 12:09am UTC](https://forum.djangoproject.com/t/on-an-issue-between-consumer-and-worker/44523/18 "2026-03-17T00:09:07Z")

</div>

Something that might show progress, an error message in the worker terminal (might have closed my redis terminal causing this error). Sorry.

Traceback (most recent call last):  
File “C:\Users\Brian Ketelboeter\Roshambo\roshambo\manage.py”, line 22, in  
main()  
File “C:\Users\Brian Ketelboeter\Roshambo\roshambo\manage.py”, line 18, in main  
execute\_from\_command\_line(sys.argv)  
File “C:\Users\Brian Ketelboeter\Roshambo.venv\Lib\site-packages\django\core\management\__init_\_.py”, line 442, in execute\_from\_command\_line  
utility.execute()  
File “C:\Users\Brian Ketelboeter\Roshambo.venv\Lib\site-packages\django\core\management\__init_\_.py”, line 436, in execute  
self.fetch\_command(subcommand).run\_from\_argv(self.argv)  
File “C:\Users\Brian Ketelboeter\Roshambo.venv\Lib\site-packages\django\core\management\base.py”, line 416, in run\_from\_argv  
self.execute(\*args, \*\*cmd\_options)  
File “C:\Users\Brian Ketelboeter\Roshambo.venv\Lib\site-packages\django\core\management\base.py”, line 460, in execute  
output = self.handle(\*args, \*\*options)  
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
File “C:\Users\Brian Ketelboeter\Roshambo.venv\Lib\site-packages\channels\management\commands\runworker.py”, line 45, in handle  
worker.run()  
File “C:\Users\Brian Ketelboeter\Roshambo.venv\Lib\site-packages\asgiref\server.py”, line 61, in run  
event\_loop.run\_until\_complete(self.arun())  
File “C:\Users\Brian Ketelboeter\AppData\Roaming\uv\python\cpython-3.12.11-windows-x86\_64-none\Lib\asyncio\base\_events.py”, line 691, in run\_until\_complete  
return future.result()  
^^^^^^^^^^^^^^^  
File “C:\Users\Brian Ketelboeter\Roshambo.venv\Lib\site-packages\asgiref\server.py”, line 78, in arun  
await asyncio.gather(self.application\_checker(), handle())  
File “C:\Users\Brian Ketelboeter\Roshambo.venv\Lib\site-packages\asgiref\server.py”, line 74, in handle  
await self.handle()  
File “C:\Users\Brian Ketelboeter\Roshambo.venv\Lib\site-packages\channels\worker.py”, line 30, in handle  
[listener.result() for listener in listeners]  
^^^^^^^^^^^^^^^^^  
File “C:\Users\Brian Ketelboeter\Roshambo.venv\Lib\site-packages\channels\worker.py”, line 37, in listener  
message = await self.channel\_layer.receive(channel)  
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
File “C:\Users\Brian Ketelboeter\Roshambo.venv\Lib\site-packages\channels\_redis\core.py”, line 373, in receive  
return (await self.receive\_single(channel))[1]  
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
File “C:\Users\Brian Ketelboeter\Roshambo.venv\Lib\site-packages\channels\_redis\core.py”, line 397, in receive\_single content = await self.\_brpop\_with\_clean(  
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
File “C:\Users\Brian Ketelboeter\Roshambo.venv\Lib\site-packages\channels\_redis\core.py”, line 233, in \_brpop\_with\_clean  
result = await connection.bzpopmin(channel, timeout=timeout)  
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
File “C:\Users\Brian Ketelboeter\Roshambo.venv\Lib\site-packages\redis\asyncio\client.py”, line 725, in execute\_command  
return await conn.retry.call\_with\_retry(  
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
File “C:\Users\Brian Ketelboeter\Roshambo.venv\Lib\site-packages\redis\asyncio\retry.py”, line 55, in call\_with\_retry raise error  
File “C:\Users\Brian Ketelboeter\Roshambo.venv\Lib\site-packages\redis\asyncio\retry.py”, line 50, in call\_with\_retry return await do()  
^^^^^^^^^^  
File “C:\Users\Brian Ketelboeter\Roshambo.venv\Lib\site-packages\redis\asyncio\client.py”, line 700, in \_send\_command\_parse\_response  
return await self.parse\_response(conn, command\_name, \*\*options)  
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
File “C:\Users\Brian Ketelboeter\Roshambo.venv\Lib\site-packages\redis\asyncio\client.py”, line 746, in parse\_response  
response = await connection.read\_response()  
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
File “C:\Users\Brian Ketelboeter\Roshambo.venv\Lib\site-packages\redis\asyncio\connection.py”, line 607, in read\_response  
response = await self.\_parser.read\_response(  
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
File “C:\Users\Brian Ketelboeter\Roshambo.venv\Lib\site-packages\redis\_parsers\resp2.py”, line 82, in read\_response  
response = await self.\_read\_response(disable\_decoding=disable\_decoding)  
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
File “C:\Users\Brian Ketelboeter\Roshambo.venv\Lib\site-packages\redis\_parsers\resp2.py”, line 90, in \_read\_response raw = await self.\_readline()  
^^^^^^^^^^^^^^^^^^^^^^  
File “C:\Users\Brian Ketelboeter\Roshambo.venv\Lib\site-packages\redis\_parsers\base.py”, line 470, in \_readline  
raise ConnectionError(SERVER\_CLOSED\_CONNECTION\_ERROR)  
redis.exceptions.ConnectionError: Connection closed by server.

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [March 17, 2026, 12:20am UTC](https://forum.djangoproject.com/t/on-an-issue-between-consumer-and-worker/44523/19 "2026-03-17T00:20:37Z")

</div>

What version of Python are you using? (It looks like you might be using 3.12?)

What version of channels\_redis?

You might want to try this with Python 3.13 and Redis 6.

> [@brian-ketelboeter](#):
>
> ```auto
> getting here is half the job
> 
> ```

Where is this line coming from? I don’t see that in any of the code you’ve posted.

---

<div class="post-metadata">

**Author:** ![brian-ketelboeter](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/brian-ketelboeter/32/30559_2.png) [@brian-ketelboeter](https://forum.djangoproject.com/u/brian-ketelboeter)\
**Post date:** [March 17, 2026, 7:05pm UTC](https://forum.djangoproject.com/t/on-an-issue-between-consumer-and-worker/44523/20 "2026-03-17T19:05:29Z")

</div>

> [@brian-ketelboeter](#):
>
> `getting here is half the job`

This line came from the game app (the next part of the project connected to the game play). The above consumers are both in the lobby part.

[Next page](https://forum.djangoproject.com/t/on-an-issue-between-consumer-and-worker/44523.md?page=2)
