django channels redis 多个消费者在不同的时间收到消息吗?

标签 django websocket redis django-channels

这是否需要实现或已经在 channel 中?

如果我有一个有多个消费者订阅的 channel 组,并且发送了一个消费者消息是消息丢失给其他消费者,还是消息一直存在直到所有消费者都看到该消息?

或者无论消费者是否看到消息,消息都会持续一段时间直到时间到期?

最佳答案

Group 对象管理对所有消费者的传递(如果可能)和消息过期。但请注意,无法保证交付。

来自documentation :

Channels implements this abstraction as a core concept called Groups ...

[Groups] also automatically manage expiry of the group members - when the channel starts having messages expire on it due to non-consumption, we go in and remove it from all the groups it’s in as well ...

One thing channels do not do, however, is guarantee delivery. If you need certainty that tasks will complete, use a system designed for this with retries and persistence (e.g. Celery)

关于django channels redis 多个消费者在不同的时间收到消息吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47318314/

相关文章:

java - 当同一对象运行回调时重新创建对象的设计模式

websocket - 如何在 Dropwizard 中实现 websocket

.net - 如何在StackExchange.Redis中使用Redis群集?

redis - 如何指定使用哪个redis安装?

django - Django 1.8 中带有 last_login 字段的 IntegrityError

django - 如何根据 Django 中的登录状态使用不同的数据库?

即使 required=False 也需要 Django REST Framework 序列化器字段

python - Messenger 平台中的位置小部件在移动版中显示搜索栏,但在桌面版中不显示

php - PHP套接字: From php server to web client

ruby-on-rails - 如何在redis中创建数据库(key_space)