GitHub

ConnectionHooksService

API reference for ConnectionHooksService.

Effects a socket protocol runs when it connects and when it disconnects (Effect's RpcClient.ConnectionHooks).

Attributes

AttributeTypeDescription
on_connectEffect[None]

Run each time the socket connects (its reader opened), before any message is read; it never fails.

on_disconnectEffect[None]

Run each time a connection attempt ends (the socket failed or a ping timed out), whether or not it had connected; it never fails.

Functions

__init__

__init__(on_connect, on_disconnect) -> None
ParameterTypeDescription
on_connectEffect[None]
on_disconnectEffect[None]
def __init__(self, on_connect: Effect[None], on_disconnect: Effect[None]) -> None:
    self._on_connect = on_connect
    self._on_disconnect = on_disconnect