Package io.camunda.zeebe.transport.impl
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
-
Nested Class Summary
Nested classes/interfaces inherited from class io.camunda.zeebe.scheduler.Actor
Actor.ActorBuilder -
Field Summary
Fields inherited from class io.camunda.zeebe.scheduler.Actor
actor, ACTOR_PROP_NAME, ACTOR_PROP_PARTITION_ID -
Constructor Summary
ConstructorsConstructorDescriptionAtomixServerTransport(MessagingService messagingService, org.agrona.concurrent.IdGenerator requestIdGenerator) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()getName()voidsendResponse(ServerResponse response) Sends the given response.subscribe(int partitionId, RequestType requestType, RequestHandler requestHandler) Subscribes to the given partition and call's the given handler on each new request of the given type.unsubscribe(int partitionId, RequestType requestType) Unsubscribe from the given partition, the registered handler will no longer be called on new requests.Methods inherited from class io.camunda.zeebe.scheduler.Actor
buildActorName, call, closeAsync, createContext, getContext, handleFailure, isActorClosed, newActor, onActorClosed, onActorCloseRequested, onActorClosing, onActorFailed, onActorStarted, onActorStarting, run, runOnCompletion, runOnCompletion, schedule, wrapMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.camunda.zeebe.scheduler.ConcurrencyControl
createCompletedFuture, createFuture, execute
-
Constructor Details
-
AtomixServerTransport
public AtomixServerTransport(MessagingService messagingService, org.agrona.concurrent.IdGenerator requestIdGenerator)
-
-
Method Details
-
getName
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classActor
-
subscribe
public ActorFuture<Void> subscribe(int partitionId, RequestType requestType, RequestHandler requestHandler) Description copied from interface:ServerTransportSubscribes to the given partition and call's the given handler on each new request of the given type.- Specified by:
subscribein interfaceServerTransport- Parameters:
partitionId- the partition, for which should be subscribedrequestType- the type of request that should be handledrequestHandler- the handler which should be called.
-
unsubscribe
Description copied from interface:ServerTransportUnsubscribe from the given partition, the registered handler will no longer be called on new requests.- Specified by:
unsubscribein interfaceServerTransport- Parameters:
partitionId- the partition, from which we should unsubscriberequestType-
-
sendResponse
Description copied from interface:ServerOutputSends 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:
sendResponsein interfaceServerOutput- Parameters:
response- the response which should be send
-