Effects a socket protocol runs when it connects and when it
disconnects (Effect's RpcClient.ConnectionHooks).
Attributes#
| Attribute | Type | Description |
|---|---|---|
on_connect | Effect[None] | Run each time the socket connects (its reader opened), before any message is read; it never fails. |
on_disconnect | Effect[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| Parameter | Type | Description |
|---|---|---|
on_connect | Effect[None] | |
on_disconnect | Effect[None] |
def __init__(self, on_connect: Effect[None], on_disconnect: Effect[None]) -> None:
self._on_connect = on_connect
self._on_disconnect = on_disconnect