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(memberId(), request);
      });
    }
  }
private void sendEvents ( EventHolder event ) { 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 ( memberId ( ) , request ) ; } ) ; } }
Sends an event to the session.