use of io.atomix.protocols.raft.protocol.PublishRequest in project atomix by atomix.
the class RaftSession method sendEvents.
/**
* Sends an event to the session.
*/
private void sendEvents(EventHolder event) {
// Only send events to the client if this server is the leader.
if (server.isLeader()) {
eventExecutor.execute(() -> {
PublishRequest request = PublishRequest.builder().withSession(sessionId().id()).withEventIndex(event.eventIndex).withPreviousIndex(event.previousIndex).withEvents(event.events).build();
log.trace("Sending {}", request);
protocol.publish(member, request);
});
}
}
Aggregations