Class DefaultPublisher

java.lang.Object
com.iohao.net.common.DefaultPublisher
All Implemented Interfaces:
Publisher

public final class DefaultPublisher extends Object implements Publisher
Default single-threaded Publisher implementation backed by per-publication queues.

Messages are queued by publication name and encoded on the publisher thread before being offered to Aeron.

Since:
25.1
Author:
渔民小镇
date:
2025-09-27
  • Constructor Details

    • DefaultPublisher

      public DefaultPublisher()
  • Method Details

    • addPublication

      public void addPublication(String name, io.aeron.Publication publication)
      Description copied from interface: Publisher
      Adds a named Aeron publication target.
      Specified by:
      addPublication in interface Publisher
      Parameters:
      name - publication name
      publication - Aeron publication
    • publishMessage

      public void publishMessage(String name, Object message)
      Description copied from interface: Publisher
      Enqueues a message for publication.
      Specified by:
      publishMessage in interface Publisher
      Parameters:
      name - publication name
      message - message to publish
    • startup

      public void startup()
      Description copied from interface: Publisher
      Starts background publishing resources.
      Specified by:
      startup in interface Publisher
    • shutdown

      public void shutdown()
      Description copied from interface: Publisher
      Stops background publishing resources.
      Specified by:
      shutdown in interface Publisher