4.1.33 on_peer_connection_change(Hook, Prio)

-spec on_peer_connection_change(Fun,
                                classy_hook:conf()) -> classy_hook:hook() when Fun ::
                                                                                   fun((Remote,
                                                                                        node(),
                                                                                        _IsConnected ::
                                                                                            boolean()) -> _),
                                                                               Remote ::
                                                                                   site().

Register a hook that is executed when a site changes status from connected (true) to disconnected (false) and vice versa.

Note: this hook runs in the classy main process. Hence it should avoid blocking it.

WARNING: status change to false is not indicative of the remote site being actually down. This can happen during a network partition.

JavaScript license information