communciation error between channely layer and Redis

Viewed 125

I installed Redis version 6.0.6 in Linux

I am following this tutorial on Django channels, and I ran the following code:

>>> import channels.layers
>>> channel_layer = channels.layers.get_channel_layer()
>>> from asgiref.sync import async_to_sync
>>> async_to_sync(channel_layer.send)('test_channel',{'type':'hello'})
>>> async_to_sync(channel_layer.receive)('test_channel')

and I got the error like this

 Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/home/peacekim/chat/venv/lib/python3.6/site-packages/asgiref/sync.py", line 139, in __call__
    return call_result.result()
  File "/usr/lib/python3.6/concurrent/futures/_base.py", line 425, in result
    return self.__get_result()
  File "/usr/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/home/peacekim/chat/venv/lib/python3.6/site-packages/asgiref/sync.py", line 204, in main_wrap
    result = await self.awaitable(*args, **kwargs)
  File "/home/peacekim/chat/venv/lib/python3.6/site-packages/channels_redis/core.py", line 485, in receive
    return (await self.receive_single(channel))[1]
  File "/home/peacekim/chat/venv/lib/python3.6/site-packages/channels_redis/core.py", line 508, in receive_single
    index, channel_key, timeout=self.brpop_timeout
  File "/home/peacekim/chat/venv/lib/python3.6/site-packages/channels_redis/core.py", line 345, in _brpop_with_clean
    result = await connection.bzpopmin(channel, timeout=timeout)
aioredis.errors.ReplyError: ERR unknown command 'BZPOPMIN'

How can I solve this error.please...

0 Answers
Related