Package io.zeebe.transport.impl
Class AtomixServerTransport
- java.lang.Object
-
- io.zeebe.util.sched.Actor
-
- io.zeebe.transport.impl.AtomixServerTransport
-
- All Implemented Interfaces:
ServerOutput
,ServerTransport
,CloseableSilently
,AsyncClosable
,AutoCloseable
public class AtomixServerTransport extends Actor implements ServerTransport
-
-
Constructor Summary
Constructors Constructor Description AtomixServerTransport(int nodeId, MessagingService messagingService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
String
getName()
void
sendResponse(ServerResponse response)
Sends the given response.ActorFuture<Void>
subscribe(int partitionId, RequestHandler requestHandler)
Subscribes to the given partition and call's the given handler on each new request.ActorFuture<Void>
unsubscribe(int partitionId)
Unsubscribe from the given partition, the registered handler will no longer be called on new requests.-
Methods inherited from class io.zeebe.util.sched.Actor
buildActorName, closeAsync, handleFailure, isActorClosed, onActorClosed, onActorCloseRequested, onActorClosing, onActorFailed, onActorStarted, onActorStarting, wrap
-
-
-
-
Constructor Detail
-
AtomixServerTransport
public AtomixServerTransport(int nodeId, MessagingService messagingService)
-
-
Method Detail
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseableSilently
- Overrides:
close
in classActor
-
subscribe
public ActorFuture<Void> subscribe(int partitionId, RequestHandler requestHandler)
Description copied from interface:ServerTransport
Subscribes to the given partition and call's the given handler on each new request.- Specified by:
subscribe
in interfaceServerTransport
- Parameters:
partitionId
- the partition, for which should be subscribedrequestHandler
- the handler which should be called.
-
unsubscribe
public ActorFuture<Void> unsubscribe(int partitionId)
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 interfaceServerTransport
- Parameters:
partitionId
- the partition, from which we should unsubscribe
-
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 interfaceServerOutput
- Parameters:
response
- the response which should be send
-
-