Class InMemoryRealtimeBus
java.lang.Object
com.kingsrook.qqq.backend.core.realtime.InMemoryRealtimeBus
- All Implemented Interfaces:
RealtimeBusInterface,AutoCloseable
Synchronous fan-out on virtual threads; a failed listener never fails a write.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Release the executor and listeners.voidpublish(RealtimeMessage message) Run each listener independently and await this publication.subscribe(Consumer<RealtimeMessage> listener) The subscription handle removes only this listener.
-
Constructor Details
-
InMemoryRealtimeBus
public InMemoryRealtimeBus()
-
-
Method Details
-
publish
Run each listener independently and await this publication.- Specified by:
publishin interfaceRealtimeBusInterface
-
subscribe
The subscription handle removes only this listener.- Specified by:
subscribein interfaceRealtimeBusInterface
-
close
public void close()Release the executor and listeners.- Specified by:
closein interfaceAutoCloseable
-