Class ReactiveFeeder

java.lang.Object
software.spool.publisher.api.strategy.ReactiveFeeder
All Implemented Interfaces:
FeederStrategy

public class ReactiveFeeder extends Object implements FeederStrategy
Reactive FeederStrategy that listens for InboxItemStored events on the event bus and processes each one immediately.

When started, this strategy subscribes to InboxItemStored events. Each event triggers the handler which updates the inbox status to PUBLISHING, emits an ItemPublished event, and marks the item as PUBLISHED.

This strategy is best suited for low-latency, event-driven architectures where items should be published as soon as they arrive in the inbox.

  • Constructor Summary

    Constructors
    Constructor
    Description
    ReactiveFeeder(software.spool.core.port.EventBusListener eventBusListener, software.spool.core.control.Handler<software.spool.core.model.InboxItemStored> handler)
    Creates a new reactive feeder.
  • Method Summary

    Modifier and Type
    Method
    Description
    software.spool.core.port.Subscription
    Subscribes to InboxItemStored events on the event bus.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface software.spool.publisher.api.strategy.FeederStrategy

    stop
  • Constructor Details

    • ReactiveFeeder

      public ReactiveFeeder(software.spool.core.port.EventBusListener eventBusListener, software.spool.core.control.Handler<software.spool.core.model.InboxItemStored> handler)
      Creates a new reactive feeder.
      Parameters:
      eventBusListener - the event bus listener to subscribe with
      handler - the handler that processes each inbox item
  • Method Details

    • start

      public software.spool.core.port.Subscription start()
      Subscribes to InboxItemStored events on the event bus.
      Specified by:
      start in interface FeederStrategy
      Returns:
      a Subscription that can be cancelled to stop publishing