Interface NetworkTransport

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
RedisTransport

public interface NetworkTransport extends AutoCloseable
Binary publish/subscribe transport used for cross-server messages.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Closeable subscription to one logical channel.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes all subscriptions and rejects new work.
    void
    publish(String channel, byte[] payload)
    Publishes one binary message.
    subscribe(String channel, Consumer<byte[]> listener)
    Subscribes to a logical channel.
  • Method Details

    • publish

      void publish(String channel, byte[] payload)
      Publishes one binary message.
      Parameters:
      channel - logical channel name
      payload - immutable message bytes for the duration of the call
    • subscribe

      NetworkTransport.Subscription subscribe(String channel, Consumer<byte[]> listener)
      Subscribes to a logical channel.
      Parameters:
      channel - logical channel name
      listener - message callback
      Returns:
      subscription handle
    • close

      void close()
      Closes all subscriptions and rejects new work.
      Specified by:
      close in interface AutoCloseable