Prepare for Sinks API updates in Reactor
See reactor/reactor-core#2374 All usages of this API are in tests, which are not checking overflow or concurrent emissions - so a simple replacement with `try***` equivalents is fine.
This commit is contained in:
@@ -246,7 +246,7 @@ class RSocketBufferLeakTests {
|
||||
void checkForLeaks() {
|
||||
this.rsockets.stream().map(PayloadSavingDecorator::getPayloads)
|
||||
.forEach(payloadInfoProcessor -> {
|
||||
payloadInfoProcessor.emitComplete();
|
||||
payloadInfoProcessor.tryEmitComplete();
|
||||
payloadInfoProcessor.asFlux()
|
||||
.doOnNext(this::checkForLeak)
|
||||
.blockLast();
|
||||
@@ -328,7 +328,7 @@ class RSocketBufferLeakTests {
|
||||
}
|
||||
|
||||
private io.rsocket.Payload addPayload(io.rsocket.Payload payload) {
|
||||
this.payloads.emitNext(new PayloadLeakInfo(payload));
|
||||
this.payloads.tryEmitNext(new PayloadLeakInfo(payload));
|
||||
return payload;
|
||||
}
|
||||
|
||||
|
||||
@@ -231,7 +231,7 @@ public class RSocketClientToServerIntegrationTests {
|
||||
|
||||
@MessageMapping("receive")
|
||||
void receive(String payload) {
|
||||
this.fireForgetPayloads.emitNext(payload);
|
||||
this.fireForgetPayloads.tryEmitNext(payload);
|
||||
}
|
||||
|
||||
@MessageMapping("echo")
|
||||
@@ -273,7 +273,7 @@ public class RSocketClientToServerIntegrationTests {
|
||||
|
||||
@ConnectMapping("foo-updates")
|
||||
public void handleMetadata(@Header("foo") String foo) {
|
||||
this.metadataPushPayloads.emitNext(foo);
|
||||
this.metadataPushPayloads.tryEmitNext(foo);
|
||||
}
|
||||
|
||||
@MessageExceptionHandler
|
||||
|
||||
@@ -219,7 +219,7 @@ class RSocketServerToClientIntegrationTests {
|
||||
|
||||
@MessageMapping("receive")
|
||||
void receive(String payload) {
|
||||
this.fireForgetPayloads.emitNext(payload);
|
||||
this.fireForgetPayloads.tryEmitNext(payload);
|
||||
}
|
||||
|
||||
@MessageMapping("echo")
|
||||
|
||||
@@ -371,7 +371,7 @@ public class SimpAnnotationMethodMessageHandlerTests {
|
||||
this.messageHandler.handleMessage(message);
|
||||
|
||||
assertThat(controller.fluxSink).isNotNull();
|
||||
controller.fluxSink.emitNext("foo");
|
||||
controller.fluxSink.tryEmitNext("foo");
|
||||
|
||||
verify(this.converter, never()).toMessage(any(), any(MessageHeaders.class));
|
||||
}
|
||||
|
||||
@@ -149,13 +149,13 @@ class RSocketClientToServerCoroutinesIntegrationTests {
|
||||
|
||||
@MessageMapping("receive")
|
||||
fun receive(payload: String) {
|
||||
fireForgetPayloads.emitNext(payload)
|
||||
fireForgetPayloads.tryEmitNext(payload)
|
||||
}
|
||||
|
||||
@MessageMapping("receive-async")
|
||||
suspend fun receiveAsync(payload: String) {
|
||||
delay(10)
|
||||
fireForgetPayloads.emitNext(payload)
|
||||
fireForgetPayloads.tryEmitNext(payload)
|
||||
}
|
||||
|
||||
@MessageMapping("echo-async")
|
||||
|
||||
Reference in New Issue
Block a user