Re: Using Django Channels to subscribe to a Redis channel

2018-11-22 Thread Yavin Aalto Arba
You need to set up the consumer to perform this task. cf. https://github.com/justdjango/justchat/blob/master/src/chat/consumers.py this corresponds to the following video tutorial which might be useful to you: https://www.youtube.com/watch?v=Wv5jlmJs2sU On Thu, 22 Nov 2018 at 15:34, Nasir Sh wr

Re: Using Django Channels to subscribe to a Redis channel

2018-11-22 Thread Nasir Sh
Thanks Yyavin, the problem is that in my management command I don't have access to `self` to send it. Is it possible to get access to a consumer from outside or how should my data producer relay the messages to channel in an async way? On Wednesday, November 21, 2018 at 8:47:07 PM UTC+1, Yavin

Re: Using Django Channels to subscribe to a Redis channel

2018-11-22 Thread Nasir Shadravan
Thanks Yyavin, the problem is that in my management command I don't have access to `self` to send it. Is it possible to get access to a consumer from outside or how should my data producer relay the messages to channel in an async way? On Wed, Nov 21, 2018 at 8:46 PM Yavin Aalto Arba wrote: > tr

Re: Using Django Channels to subscribe to a Redis channel

2018-11-21 Thread Yavin Aalto Arba
try with self.channel_layer.group_send ? On Wed, 21 Nov 2018 at 19:44, Nasir Sh wrote: > Thanks Andrew this helps me as well. There is a missing piece I don't > understand yet. In my management command, then I probably will have to use > `async_to_sync(channel_layer.group_send)` > to send the

Re: Using Django Channels to subscribe to a Redis channel

2018-11-21 Thread Nasir Sh
Thanks Andrew this helps me as well. There is a missing piece I don't understand yet. In my management command, then I probably will have to use `async_to_sync(channel_layer.group_send)` to send the message to consumers (right?). The only problem is that whenever I use async_to_sync it creates

Re: Using Django Channels to subscribe to a Redis channel

2018-07-11 Thread morlandi
I posted a working snippet here https://gist.github.com/morlandi/bb915db7acef0ee0e4cb070921208610 It's a Django management command which subscribes a Redis channel, and upon receiving a new message sends it to django-channel. You can skip the logging and redis connection boilerplate, and take a

Re: Using Django Channels to subscribe to a Redis channel

2018-04-30 Thread Michael
Did you have luck with this. I've tried the same thing, but it seems like if no one is consuming on the other side I get a "channels.exceptions.ChannelFull" exception. I'm trying to provide a real-time feed for an exchange. There might be zero people listing or 1 million listening. The high le

Re: Using Django Channels to subscribe to a Redis channel

2017-02-23 Thread Jochen Breuer
Hi Andrew, thanks for your very detailed answer! This is much simpler that anticipated. You are absolutely right, a management command is the most simple approach here. That was the missing piece in my picture. Thank you very much! Jochen Am Mittwoch, 22. Februar 2017 19:55:33 UTC+1 schr

Re: Using Django Channels to subscribe to a Redis channel

2017-02-22 Thread Andrew Godwin
Hi Jochen, Your problem is that if you want to listen to the pubsub channel you will need a dedicated process to do so, as you can't just poll something like that. Given that restriction, you're going to have to write something like a management command that opens a connection to Redis and listens