Consumer methods 'channel_layer.send', 'channel_layer.group_send' and 'channel_layer.receive' not working well.
Guidoow opened this issue · comments
Guido Moran commented
Hi everyone. You should keep in mind that my english may be not too well and too that im quite new to the dev world.
12 days ago, i asked help in -Discussions- section, but i didn't achieve to fix this problem. [ github.com//discussions/1931 ]
Aclarations:
- Im not testing on web, but on dart.
- I tried with consumer functions that inherit from WebsocketConsumer, SyncConsumer and AsyncConsumer
- As I understood from reading the docs, the
channel_layer.group_send
and thechannel_layer.send
methods adds sent messages to a queue and, if there is a specified "type" key in the sent dictionary, executes a function (named in the key value) for a consumer which is in the specified group and has a persistent connection. - This seems to be an error, but it doesn't display anything in the console so i can't put some console log error here.
- Im completly secure that im using the functions correctly, and i consider non effective to put the code here, anyway, you can go to the above link where i asked before, there i published some.
What i expect:
- Channel layers sending messages to independent consumers. It can be with the above descripted behaviour (funct execution), and don't matter if there are in a group (
channel_layer.group_send
) or if i need to send to the channels directly (channel_layer.send
), anyone would work for what im building.
What happened:
- Channel layers only add the messages sended to a queue (either there are sended to a group or to specified channel) but don't send them automatically, neither executes the function, how the documentation describes.
- Trying to achieve the above functionality, i tried to receiving the messages with
channel_layers.receive()
and is actually working, BUT when i execute a receive and there are not messages in the queue for that consumer, the server completly stops, and need to be restarted.
May help:
- Windows 10.
- pip freeze: https://user-images.githubusercontent.com/104577925/197873336-a268086c-d1d1-479c-9930-a21d92a8665a.png
Thanks for read and i appreciate it the help :)
Carlton Gibson commented