Class LocalMessaging
java.lang.Object
dev.moonbridge.messaging.internal.LocalMessaging
- All Implemented Interfaces:
AutoCloseable
Host-side scope registry and bounded local message dispatcher. The host owns the supplied scheduler and
executors and must keep the completion executor-independent messaging service alive until it is closed.
Plugin handlers/listeners run on their scope executor; public operation futures complete on a separate
completion executor so closing a plugin executor cannot strand them or run continuations on a transport reader.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceHost transport boundary. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLocalMessaging(Endpoint self, LocalMessaging.Outbound outbound, Executor defaultExecutor, ScheduledExecutorService scheduler) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Opens an exclusively named plugin scope using the host's default callback executor.Opens an exclusively named plugin scope using the supplied callback executor.receiveEvent(Message message) Enqueues an inbound event for each active local listener.receiveRequest(Message request, Duration timeout) Dispatches an inbound request and completes with its correlated reply.Returns a snapshot of channels and their current local subscription flags.
-
Field Details
-
MAX_IN_FLIGHT
public static final int MAX_IN_FLIGHT- See Also:
-
DEFAULT_REQUEST_TIMEOUT
-
MAX_REQUEST_TIMEOUT
-
-
Constructor Details
-
LocalMessaging
public LocalMessaging(Endpoint self, LocalMessaging.Outbound outbound, Executor defaultExecutor, ScheduledExecutorService scheduler)
-
-
Method Details
-
openScope
-
openScope
-
receiveEvent
Enqueues an inbound event for each active local listener. The result describes only local queue acceptance, not callback success. Queue slots are released if an owner closes while callbacks remain queued, even when its executor discards those callbacks. -
receiveRequest
Dispatches an inbound request and completes with its correlated reply. The deadline includes waiting for the owning callback executor and asynchronous handler completion. -
subscriptions
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-