You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While attempting to fix #270, I realized that the PubSub layer doesn't actually conform to the Channels Layer Spec.
In particular, the spec says:
Channels are a first-in, first out queue with at-most-once delivery semantics. They can have multiple writers and multiple readers; only a single reader should get each written message. Implementations must never deliver a message more than once or to more than one reader, and must drop messages if this is necessary to achieve this restriction.
While the PubSub layer is "at-most-once", it doesn't guarantee that a message will only be delivered to a single reader. This has implications for workers as having multiple workers listening to the same channel will result in duplicate messages.
A potential solution is to introduce a Redis Streams layer which allows such guarantees. The challenge with Redis Streams is cleaning up messages to ensure "at-most-once" and to keep the memory usage sane. On the bright side, it would re-introduce some of the fault tolerance that was lost with the PubSub layer.
The text was updated successfully, but these errors were encountered:
While attempting to fix #270, I realized that the PubSub layer doesn't actually conform to the Channels Layer Spec.
In particular, the spec says:
While the PubSub layer is "at-most-once", it doesn't guarantee that a message will only be delivered to a single reader. This has implications for workers as having multiple workers listening to the same channel will result in duplicate messages.
A potential solution is to introduce a Redis Streams layer which allows such guarantees. The challenge with Redis Streams is cleaning up messages to ensure "at-most-once" and to keep the memory usage sane. On the bright side, it would re-introduce some of the fault tolerance that was lost with the PubSub layer.
The text was updated successfully, but these errors were encountered: