private void onConnect() { DebugLogger.log( LIBRARY_CONNECT, "%d: Connected to [%s]%n", libraryId, currentAeronChannel); configuration.libraryConnectHandler().onConnect(fixLibrary); setLibraryConnected(true); }
private void shouldReplyToOnNotLeaderWith( final IntSupplier libraryId, final LongSupplier connectCorrelationId, final String... channels) { whenPolled() .then( (inv) -> { library.onNotLeader(libraryId.getAsInt(), connectCorrelationId.getAsLong(), LEADER_CHANNEL); return 1; }) .then(replyWithApplicationHeartbeat()) .then(noReply()); newLibraryPoller(CLUSTER_CHANNELS); library.startConnecting(); pollTwice(); poll(); attemptToConnectTo(channels); verify(connectHandler).onConnect(fixLibrary); }