Skip to content

Commit c8fa309

Browse files
committed
Fixed Sinks.one(), also added RetryEmitFailureHandler
1 parent 32aeafb commit c8fa309

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

cluster/src/main/java/io/scalecube/cluster/ClusterImpl.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,14 @@ private void initLifecycle() {
123123
start
124124
.asMono()
125125
.then(doStart())
126-
.doOnSuccess(c -> onStart.tryEmitEmpty())
127-
.doOnError(onStart::tryEmitError)
126+
.doOnSuccess(c -> onStart.emitEmpty(RetryEmitFailureHandler.INSTANCE))
127+
.doOnError(th -> onStart.emitError(th, RetryEmitFailureHandler.INSTANCE))
128128
.subscribe(null, th -> LOGGER.error("[{}][doStart] Exception occurred:", localMember, th));
129129

130130
shutdown
131131
.asMono()
132132
.then(doShutdown())
133-
.doFinally(s -> onShutdown.tryEmitEmpty())
133+
.doFinally(s -> onShutdown.emitEmpty(RetryEmitFailureHandler.INSTANCE))
134134
.subscribe(
135135
null,
136136
th ->
@@ -236,7 +236,7 @@ public ClusterImpl handler(Function<Cluster, ClusterMessageHandler> handler) {
236236
public Mono<Cluster> start() {
237237
return Mono.defer(
238238
() -> {
239-
start.tryEmitEmpty();
239+
start.emitEmpty(RetryEmitFailureHandler.INSTANCE);
240240
return onStart.asMono().thenReturn(this);
241241
});
242242
}
@@ -489,7 +489,7 @@ public <T> Mono<Void> updateMetadata(T metadata) {
489489

490490
@Override
491491
public void shutdown() {
492-
shutdown.tryEmitEmpty();
492+
shutdown.emitEmpty(RetryEmitFailureHandler.INSTANCE);
493493
}
494494

495495
private Mono<Void> doShutdown() {

transport-parent/transport-netty/src/main/java/io/scalecube/transport/netty/TransportImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ private void init(DisposableServer server) {
9090
// Setup cleanup
9191
stop.asMono()
9292
.then(doStop())
93-
.doFinally(s -> onStop.tryEmitEmpty())
93+
.doFinally(s -> onStop.emitEmpty(RetryEmitFailureHandler.INSTANCE))
9494
.subscribe(
9595
null, ex -> LOGGER.warn("[{}][doStop] Exception occurred: {}", address, ex.toString()));
9696
}
@@ -181,7 +181,7 @@ public boolean isStopped() {
181181
public final Mono<Void> stop() {
182182
return Mono.defer(
183183
() -> {
184-
stop.tryEmitEmpty();
184+
stop.emitEmpty(RetryEmitFailureHandler.INSTANCE);
185185
return onStop.asMono();
186186
});
187187
}

0 commit comments

Comments
 (0)