Class AtomixServerTransport

java.lang.Object
io.camunda.zeebe.scheduler.Actor
io.camunda.zeebe.transport.impl.AtomixServerTransport
All Implemented Interfaces:
AsyncClosable, ConcurrencyControl, ServerOutput, ServerTransport, AutoCloseable, Executor

public class AtomixServerTransport extends Actor implements ServerTransport
  • Constructor Details

    • AtomixServerTransport

      public AtomixServerTransport(MessagingService messagingService, org.agrona.concurrent.IdGenerator requestIdGenerator)
  • Method Details

    • getName

      public String getName()
      Overrides:
      getName in class Actor
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Overrides:
      close in class Actor
    • subscribe

      public ActorFuture<Void> subscribe(int partitionId, RequestType requestType, RequestHandler requestHandler)
      Description copied from interface: ServerTransport
      Subscribes to the given partition and call's the given handler on each new request of the given type.
      Specified by:
      subscribe in interface ServerTransport
      Parameters:
      partitionId - the partition, for which should be subscribed
      requestType - the type of request that should be handled
      requestHandler - the handler which should be called.
    • unsubscribe

      public ActorFuture<Void> unsubscribe(int partitionId, RequestType requestType)
      Description copied from interface: ServerTransport
      Unsubscribe from the given partition, the registered handler will no longer be called on new requests.
      Specified by:
      unsubscribe in interface ServerTransport
      Parameters:
      partitionId - the partition, from which we should unsubscribe
      requestType -
    • sendResponse

      public void sendResponse(ServerResponse response)
      Description copied from interface: ServerOutput
      Sends the given response. The corresponding partition and request id is extracted from the response object.

      This method should decouple the the request handling, such that response sending can be done later asynchronously.

      Specified by:
      sendResponse in interface ServerOutput
      Parameters:
      response - the response which should be send