Class RealtimeHub
java.lang.Object
com.kingsrook.qqq.middleware.javalin.realtime.RealtimeHub
- All Implemented Interfaces:
AutoCloseable
One server connection registry. Replay stays session-bound and is re-filtered at delivery.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA bounded transport queue; empty event is the internal close marker.static final recordWire frame, with a null event representing a comment ping. -
Constructor Summary
ConstructorsConstructorDescriptionRealtimeHub(QInstance instance) Start one bus subscription and a daemon maintenance timer.RealtimeHub(QInstance instance, Clock clock) A clock seam makes retention and permission rechecks deterministic in tests. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Unsubscribe and release all streams and the maintenance timer.Attach a transport, resuming only an owned connection with a retained event id.voiddisconnect(RealtimeHub.Attachment attachment) Transport closure retains subscriptions for the replay window.voidendSession(String sessionUuid) Logout closes every stream belonging to this session.voidValidate expiry at each heartbeat and periodically recheck every channel.Ownership is intentionally indistinguishable from a missing connection.
-
Constructor Details
-
RealtimeHub
Start one bus subscription and a daemon maintenance timer. -
RealtimeHub
-
-
Method Details
-
connect
Attach a transport, resuming only an owned connection with a retained event id. -
subscriptions
-
disconnect
Transport closure retains subscriptions for the replay window. -
maintenance
public void maintenance()Validate expiry at each heartbeat and periodically recheck every channel. -
endSession
Logout closes every stream belonging to this session. -
close
public void close()Unsubscribe and release all streams and the maintenance timer.- Specified by:
closein interfaceAutoCloseable
-