Skip to content

Commit

Permalink
fix:spotless
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Peterson <[email protected]>
  • Loading branch information
mattp-swirldslabs committed Jul 31, 2024
1 parent cb28e29 commit 93f7584
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,22 +71,24 @@ public ConsumerBlockItemObserver(
ServerCallStreamObserver<SubscribeStreamResponse>
serverCallStreamObserver) {

onCancel = () -> {
allowPublish.set(false);
streamMediator.unsubscribe(this);
LOGGER.log(
System.Logger.Level.INFO,
"Consumer cancelled stream. Observer unsubscribed.");
};
onCancel =
() -> {
allowPublish.set(false);
streamMediator.unsubscribe(this);
LOGGER.log(
System.Logger.Level.INFO,
"Consumer cancelled stream. Observer unsubscribed.");
};
serverCallStreamObserver.setOnCancelHandler(onCancel);

onClose = () -> {
allowPublish.set(false);
streamMediator.unsubscribe(this);
LOGGER.log(
System.Logger.Level.INFO,
"Consumer completed stream. Observer unsubscribed.");
};
onClose =
() -> {
allowPublish.set(false);
streamMediator.unsubscribe(this);
LOGGER.log(
System.Logger.Level.INFO,
"Consumer completed stream. Observer unsubscribed.");
};
serverCallStreamObserver.setOnCloseHandler(onClose);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@
import io.grpc.stub.ServerCallStreamObserver;
import io.grpc.stub.StreamObserver;
import java.io.IOException;
import java.time.Clock;
import java.time.InstantSource;
import java.util.List;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
Expand Down Expand Up @@ -229,7 +227,6 @@ public void testOnCancelSubscriptionHandling() throws IOException {
new LiveStreamMediatorImpl(
new FileSystemPersistenceHandler(blockReader, blockWriter));


final var testConsumerBlockItemObserver =
new TestConsumerBlockItemObserver(
TIMEOUT_THRESHOLD_MILLIS,
Expand Down Expand Up @@ -260,7 +257,6 @@ public void testOnCloseSubscriptionHandling() throws IOException {
new LiveStreamMediatorImpl(
new FileSystemPersistenceHandler(blockReader, blockWriter));


final var testConsumerBlockItemObserver =
new TestConsumerBlockItemObserver(
TIMEOUT_THRESHOLD_MILLIS,
Expand All @@ -286,9 +282,14 @@ private static class TestConsumerBlockItemObserver extends ConsumerBlockItemObse
public TestConsumerBlockItemObserver(
long timeoutThresholdMillis,
final InstantSource producerLivenessClock,
final StreamMediator<BlockItem, ObjectEvent<SubscribeStreamResponse>> streamMediator,
final StreamMediator<BlockItem, ObjectEvent<SubscribeStreamResponse>>
streamMediator,
final StreamObserver<SubscribeStreamResponse> responseStreamObserver) {
super(timeoutThresholdMillis, producerLivenessClock, streamMediator, responseStreamObserver);
super(
timeoutThresholdMillis,
producerLivenessClock,
streamMediator,
responseStreamObserver);
}

public Runnable getOnCancel() {
Expand Down

0 comments on commit 93f7584

Please sign in to comment.