Django Channels also works when I have no Worker running.

35 views
Skip to first unread message

Christopher Wittlinger

unread,
Apr 17, 2018, 9:22:22 AM4/17/18
to Django users
I am using Django Channels already quite a while (v2) and I just noticed that when I disable all my workers, that the consumers still work.

I am using the channels_redis.core.RedisChannelLayer and my Routing looks like that:
application = ProtocolTypeRouter({
    "websocket": URLRouter([
        url("^ws/chat/$", chat_consumers.ChatConsumer),
        url("^ws/notifications/$", notifications_consumers.NotificationConsumer)
    ])
})

Any ideas in this regard?

BR,

Christopher

Christopher Wittlinger

unread,
Apr 17, 2018, 9:33:03 AM4/17/18
to Django users
When I am logging from within the consumers it is logged from my web process and not the worker process.

Christopher Wittlinger

unread,
Apr 17, 2018, 9:54:14 AM4/17/18
to Django users
I think I misunderstood the concept of the workers. I thought that all Requests (HTTP and Websocket) are delegated to some sort of consumers which is run in a Worker.

Andrew Godwin

unread,
Apr 17, 2018, 1:16:40 PM4/17/18
to django...@googlegroups.com
Channels 2 does not run requests in workers. Workers are now only for running background tasks on specific channels, and so you do not need them normally.

Andrew

On Tue, Apr 17, 2018 at 6:54 AM, Christopher Wittlinger <cwittl...@gmail.com> wrote:
I think I misunderstood the concept of the workers. I thought that all Requests (HTTP and Websocket) are delegated to some sort of consumers which is run in a Worker.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/aed6a302-2e41-4aa6-bedf-86b842b9181b%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages