private static void dissect(final SubscriptionReadyFlyweight msg, final StringBuilder builder) { builder .append(msg.correlationId()) .append(' ') .append(msg.channelStatusCounterId()); }
public void onSubscriptionReady( final long correlationId, final int channelStatusCounterId) { subscriptionReady .correlationId(correlationId) .channelStatusCounterId(channelStatusCounterId); transmit(ON_SUBSCRIPTION_READY, buffer, 0, SubscriptionReadyFlyweight.LENGTH); }
@Test public void addSubscriptionShouldNotifyMediaDriver() { whenReceiveBroadcastOnMessage( ControlProtocolEvents.ON_SUBSCRIPTION_READY, subscriptionReadyBuffer, (buffer) -> { subscriptionReady.correlationId(CORRELATION_ID); return SubscriptionReadyFlyweight.LENGTH; }); conductor.addSubscription(CHANNEL, STREAM_ID_1); verify(driverProxy).addSubscription(CHANNEL, STREAM_ID_1); }
@Test public void clientNotifiedOfNewImageShouldMapLogFile() { whenReceiveBroadcastOnMessage( ControlProtocolEvents.ON_SUBSCRIPTION_READY, subscriptionReadyBuffer, (buffer) -> { subscriptionReady.correlationId(CORRELATION_ID); return SubscriptionReadyFlyweight.LENGTH; }); final Subscription subscription = conductor.addSubscription(CHANNEL, STREAM_ID_1); conductor.onAvailableImage( CORRELATION_ID, STREAM_ID_1, SESSION_ID_1, subscription.registrationId(), SUBSCRIPTION_POSITION_ID, SESSION_ID_1 + "-log", SOURCE_INFO); verify(logBuffersFactory).map(eq(SESSION_ID_1 + "-log")); }
@Test public void closingSubscriptionShouldNotifyMediaDriver() { whenReceiveBroadcastOnMessage( ControlProtocolEvents.ON_SUBSCRIPTION_READY, subscriptionReadyBuffer, (buffer) -> { subscriptionReady.correlationId(CORRELATION_ID); return SubscriptionReadyFlyweight.LENGTH; }); final Subscription subscription = conductor.addSubscription(CHANNEL, STREAM_ID_1); whenReceiveBroadcastOnMessage( ControlProtocolEvents.ON_OPERATION_SUCCESS, operationSuccessBuffer, (buffer) -> { operationSuccess.correlationId(CLOSE_CORRELATION_ID); return CorrelatedMessageFlyweight.LENGTH; }); subscription.close(); verify(driverProxy).removeSubscription(CORRELATION_ID); }
@Test public void clientNotifiedOfNewAndInactiveImages() { whenReceiveBroadcastOnMessage( ControlProtocolEvents.ON_SUBSCRIPTION_READY, subscriptionReadyBuffer, (buffer) -> { subscriptionReady.correlationId(CORRELATION_ID); return SubscriptionReadyFlyweight.LENGTH; }); final Subscription subscription = conductor.addSubscription(CHANNEL, STREAM_ID_1); conductor.onAvailableImage( CORRELATION_ID, STREAM_ID_1, SESSION_ID_1, subscription.registrationId(), SUBSCRIPTION_POSITION_ID, SESSION_ID_1 + "-log", SOURCE_INFO); assertFalse(subscription.hasNoImages()); assertTrue(subscription.isConnected()); verify(mockAvailableImageHandler).onAvailableImage(any(Image.class)); conductor.onUnavailableImage(CORRELATION_ID, subscription.registrationId(), STREAM_ID_1); verify(mockUnavailableImageHandler).onUnavailableImage(any(Image.class)); assertTrue(subscription.hasNoImages()); assertFalse(subscription.isConnected()); }
final long correlationId = subscriptionReady.correlationId(); if (correlationId == activeCorrelationId)
private static void dissect(final SubscriptionReadyFlyweight msg, final StringBuilder builder) { builder .append(msg.correlationId()) .append(' ') .append(msg.channelStatusCounterId()); }
public void onSubscriptionReady( final long correlationId, final int channelStatusCounterId) { subscriptionReady .correlationId(correlationId) .channelStatusCounterId(channelStatusCounterId); transmit(ON_SUBSCRIPTION_READY, buffer, 0, SubscriptionReadyFlyweight.LENGTH); }
public void onSubscriptionReady( final long correlationId, final int channelStatusCounterId) { subscriptionReady .correlationId(correlationId) .channelStatusCounterId(channelStatusCounterId); transmit(ON_SUBSCRIPTION_READY, buffer, 0, SubscriptionReadyFlyweight.LENGTH); }
final long correlationId = subscriptionReady.correlationId(); if (correlationId == activeCorrelationId)
final long correlationId = subscriptionReady.correlationId(); if (correlationId == activeCorrelationId)