-
- All Implemented Interfaces:
-
tv.mycujoo.mcls.network.socket.IReactorSocket
public final class ReactorSocket implements IReactorSocket
-
-
Constructor Summary
Constructors Constructor Description ReactorSocket(OkHttpClient okHttpClient, MainWebSocketListener mainSocketListener)
-
Method Summary
Modifier and Type Method Description UnitaddListener(ReactorCallback reactorCallback)UnitsetUUID(String uuid)Must be called before any usage! 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 final UnitleaveTimeline()-
-
Constructor Detail
-
ReactorSocket
ReactorSocket(OkHttpClient okHttpClient, MainWebSocketListener mainSocketListener)
-
-
Method Detail
-
addListener
Unit addListener(ReactorCallback reactorCallback)
-
setUUID
Unit setUUID(String uuid)
Must be called before any usage!
- Parameters:
uuid- must be persisted on phones storage to be unique
-
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)
-
leaveTimeline
final Unit leaveTimeline()
-
-
-
-