private void heartbeat ( ) { long index = context . nextIndex ( ) ; long timestamp = System . currentTimeMillis ( ) ; replicator . replicate ( new HeartbeatOperation ( index , timestamp ) ) . thenRun ( ( ) -> context . setTimestamp ( timestamp ) ) ; }
Applies a heartbeat to the service to ensure timers can be triggered .