-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classSocketActions.Companion
-
Method Summary
Modifier and Type Method Description abstract StateFlow<State>state()State of the socket as StateFlow abstract Flow<EventOut>events()Socket events as Flow abstract Flow<Error>errors()Socket errors as Flow abstract UnitsendData(String data)Send raw data to the socket. abstract BooleansendEvent(EventIn event)Send event to the socket. abstract Unitconnect(ConnectData connectData)Connect the user. abstract Unitreconnect(ConnectData data, Boolean force)Reconnect the user to the socket. abstract Unitdisconnect()Disconnect the socket. abstract UnitupdateToken(Token token)Update the token from the outside. abstract StateFlow<String>connectionId()Get the connection id. abstract UnitwhenConnected(Long connectionTimeout, SuspendFunction1<Throwable, Unit> connectionFailed, SuspendFunction1<String, Unit> connected)When connected to the socket. -
-
Method Detail
-
sendData
abstract Unit sendData(String data)
Send raw data to the socket. If you already have a parsed event that can be sent. Refactor later to return bool
-
connect
abstract Unit connect(ConnectData connectData)
Connect the user.
-
reconnect
abstract Unit reconnect(ConnectData data, Boolean force)
Reconnect the user to the socket.
-
disconnect
abstract Unit disconnect()
Disconnect the socket.
-
updateToken
abstract Unit updateToken(Token token)
Update the token from the outside.
-
connectionId
abstract StateFlow<String> connectionId()
Get the connection id.
-
whenConnected
abstract Unit whenConnected(Long connectionTimeout, SuspendFunction1<Throwable, Unit> connectionFailed, SuspendFunction1<String, Unit> connected)
When connected to the socket.
-
-
-
-