Class ParallelPublisher
java.lang.Object
com.iohao.net.common.ParallelPublisher
- All Implemented Interfaces:
Publisher
Parallel multi-threaded
Publisher implementation with per-publication virtual threads.
Each publication runs on its own virtual thread, eliminating head-of-line blocking between different publications and improving throughput under concurrent load. Messages sent to the same publication maintain FIFO ordering, while different publications can publish in parallel.
Use this implementation when you have multiple publications with high message rates and want to maximize throughput by parallelizing publication work.
- Since:
- 25.1
- Author:
- 渔民小镇
- date:
- 2026-03-01
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPublication(String name, io.aeron.Publication publication) Adds a named Aeron publication target.voidpublishMessage(String name, Object message) Enqueues a message for publication.voidshutdown()Stops background publishing resources.voidstartup()Starts background publishing resources.
-
Constructor Details
-
ParallelPublisher
public ParallelPublisher()
-
-
Method Details
-
addPublication
Description copied from interface:PublisherAdds a named Aeron publication target.- Specified by:
addPublicationin interfacePublisher- Parameters:
name- publication namepublication- Aeron publication
-
publishMessage
Description copied from interface:PublisherEnqueues a message for publication.- Specified by:
publishMessagein interfacePublisher- Parameters:
name- publication namemessage- message to publish
-
startup
-
shutdown
-