Channels delay server in development enviromnent

69 views
Skip to first unread message

Václav Řehák

unread,
May 24, 2017, 8:27:27 AM5/24/17
to Django developers (Contributions to Django itself)
Hi,

one of the things I like about channels is how simply it fits into development workflow with runserver. I remember how painful it was to run celery on my laptop with all the rabbitmq, worker and celery beat processes. However, I now ran into usecase requiring the use of the delay server and it seems to me I cannot use it in the simple setup with InMemory backend as I need to have rundelay as separate process (or am I missing something?).

Is there any reason why channel's runserver management command does not include delay server thread in the same way it has the WorkerThread?

Vaclav

Andrew Godwin

unread,
May 24, 2017, 12:51:15 PM5/24/17
to Django developers (Contributions to Django itself)
Hi Vaclav,

This is because there's only so much we can pack into runserver; when you develop with Celery, for example, you would probably need to run Celery unless you turn ALWAYS_EAGER on (and then not actually see any potential race conditions).

If you don't want to run Redis locally, you can use the asgi_ipc layer (https://github.com/django/asgi_ipc) which only works between processes on the same machine, but doesn't require any extra processes to run. It should get around 5,000 - 10,000 messages/second throughput on a normal laptop, which should be plenty for your use case.

If you switch to the IPC layer (or the Redis layer), you can still use "runserver" and then just launch an extra delay server, and all the components will talk to each other.

Andrew

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscribe@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/f4031868-cf1d-4149-b63a-ca98da86c788%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages