rails icon indicating copy to clipboard operation
rails copied to clipboard

Trigger `reconnected()` callback after reconnects

Open mansakondo opened this issue 1 year ago • 0 comments

Summary

The purpose is to allow subscribers to handle reconnects by defining a reconnected() callback:

import consumer from "./consumer"

consumer.subscriptions.create("ExampleChannel", {
  ...
  reconnected() {
   // Called when the subscription is confirmed after a reconnect
  },
});

That's useful if a subscriber misses some messages when the connection is lost.

mansakondo avatar Aug 02 '22 21:08 mansakondo

Thanks!

byroot avatar Sep 14 '22 11:09 byroot

Thanks!

Thanks @byroot for reviewing my first merged PR!

mansakondo avatar Sep 14 '22 11:09 mansakondo

Hi @mansakondo, I think this is missing an entry to the actioncable/CHANGELOG. Could you create a PR to add it?

p8 avatar Sep 17 '22 09:09 p8

Hi @mansakondo, I think this is missing an entry to the actioncable/CHANGELOG. Could you create a PR to add it?

Oh yeah, I forgot. Sure no problem.

mansakondo avatar Sep 17 '22 11:09 mansakondo