Class ReactorSocket
-
- All Implemented Interfaces:
-
tv.mycujoo.mclsnetwork.network.socket.IReactorSocket
public final class ReactorSocket implements IReactorSocket
-
-
Constructor Summary
Constructors Constructor Description ReactorSocket(OkHttpClient okHttpClient, MainWebSocketListener mainSocketListener, UuidUtils uuidUtils, String webSocketUrl)
-
Method Summary
Modifier and Type Method Description UnitaddListener(ReactorCallback reactorCallback)Adds a listener to event updates. UnitjoinEvent(String eventId)Joins to an Event with eventId by sending JOIN command. Unitleave(Boolean destroyAfter)Leaves a connection by sending LEAVE command. UnitjoinTimeline(JoinTimelineParam param)Join a timeline to listen to timeline changes before doing so, a connection must be active -
-
Constructor Detail
-
ReactorSocket
ReactorSocket(OkHttpClient okHttpClient, MainWebSocketListener mainSocketListener, UuidUtils uuidUtils, String webSocketUrl)
-
-
Method Detail
-
addListener
Unit addListener(ReactorCallback reactorCallback)
Adds a listener to event updates. Those changes are only triggered after an event is joined via joinEvent
- Parameters:
reactorCallback- a callback interface used to inform the user about event/annotation actions timeline updates
-
joinEvent
Unit joinEvent(String eventId)
Joins to an Event with eventId by sending JOIN command. before doing so, it checks if active connection is already established, if so it will terminate that. Also, it checks if a socket client has been created, if not, it will create one.
-
leave
Unit leave(Boolean destroyAfter)
Leaves a connection by sending LEAVE command. eventId from formerly used join command will be used
- Parameters:
destroyAfter- will decide if socket should be terminated after leaving.
-
joinTimeline
Unit joinTimeline(JoinTimelineParam param)
Join a timeline to listen to timeline changes before doing so, a connection must be active
- Parameters:
param- provides timelineId & lastActionId (optional)
-
-
-
-