Class NxGameDataImpl
java.lang.Object
app.l2nx.gs.adapter.core.gamedata.NxGameDataImpl
- All Implemented Interfaces:
app.l2nx.gs.adapter.api.spi.NxGameData
Session-scoped
NxGameData façade — a registry of snapshot triggers
bound by the gd-sync module during onConnect. Survives
reconnect: the captured reference keeps working while the underlying IO
executor is swapped on each handshake, and triggers re-register on every
fresh connect.
publishSnapshot() fans out to every registered trigger, each run
on the adapter IO executor so the caller (host game thread) never blocks on
Kafka latency. Catches Throwable from triggers to keep the host
thread safe.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbindExecutor(Executor io) Swap the IO executor used to run triggers.voidDrop all registered triggers.voidvoidregisterSnapshotTrigger(app.l2nx.gs.adapter.api.spi.NxGameDataTrigger trigger)
-
Constructor Details
-
NxGameDataImpl
public NxGameDataImpl()
-
-
Method Details
-
bindExecutor
Swap the IO executor used to run triggers. Called by adapter-core on every handshake so the stable façade always dispatches onto the live pool. -
publishSnapshot
public void publishSnapshot()- Specified by:
publishSnapshotin interfaceapp.l2nx.gs.adapter.api.spi.NxGameData
-
registerSnapshotTrigger
public void registerSnapshotTrigger(app.l2nx.gs.adapter.api.spi.NxGameDataTrigger trigger) - Specified by:
registerSnapshotTriggerin interfaceapp.l2nx.gs.adapter.api.spi.NxGameData
-
clearTriggers
public void clearTriggers()Drop all registered triggers. Called on reconnect so the gd-sync module re-registers cleanly instead of stacking duplicate triggers.
-