Peter Gerdes
Peter Gerdes

Reputation: 2978

Do all actioncable clients see messages in the same order?

I realize that actioncable doesn't guarantee messages are seen in sending order. But does it at least guarantee that all clients will see messages in the same order? I'm assuming it does since it goes through Redis pubsub and I understand Redis is single threaded but I wanted to make sure.

Upvotes: 1

Views: 213

Answers (1)

Dan Corneanu
Dan Corneanu

Reputation: 336

Each message that comes from the pubsub adapter (e.g. the ActionCable::SubscriptionAdapter::Redis) is processed and delivered to all subscribers in a separate thread using the Server#worker_pool

Hence, the answer is no. For a particular client, messages are not delivered in the same order they have been published. And the ordering of received messages, for multiple clients subscribed to the same broadcasting, will not be the same either.

Upvotes: 0

Related Questions