Package cloud.spawnery.agent.api
Interface EventBus
public interface EventBus
Where a plugin hears about things happening in the cloud.
A feed and not a ledger. An agent that was disconnected missed what happened while it was gone, and nothing replays it; the network picture it re-syncs on reconnect says what is true now. A plugin that needs a ledger should watch the objects.
Events arrive uncollapsed, one per transition. What a player sees in chat is a collapsed summary of them; you get the facts.
-
Method Summary
Modifier and TypeMethodDescriptionsubscribe(Consumer<CloudEventInfo> listener) Callslistenerfor every cloud event this agent receives, until the returned handle is closed.
-
Method Details
-
subscribe
Callslistenerfor every cloud event this agent receives, until the returned handle is closed.The listener runs on a network callback thread. Do not block it and do not touch the world from it — hand the work to your platform's scheduler. A listener that throws is dropped from the next dispatch.
Closing the handle is idempotent. Close it on disable, or the listener outlives the plugin's classloader.
-