File tree Expand file tree Collapse file tree 5 files changed +12
-12
lines changed
transport-parent/transport-netty/src/main/java/io/scalecube/transport/netty Expand file tree Collapse file tree 5 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -148,13 +148,13 @@ public static Mono<Transport> bind(TransportConfig config) {
148
148
*/
149
149
@ Override
150
150
public Mono <Transport > start () {
151
- return Mono .deferContextual (context -> receiver .bind ())
151
+ return Mono .deferWithContext (context -> receiver .bind ())
152
152
.doOnNext (this ::init )
153
153
.doOnSuccess (t -> LOGGER .info ("[bind0][{}] Bound cluster transport" , t .address ()))
154
154
.doOnError (ex -> LOGGER .error ("[bind0][{}] Exception occurred: {}" , address , ex .toString ()))
155
155
.thenReturn (this )
156
156
.cast (Transport .class )
157
- .contextWrite (
157
+ .subscriberContext (
158
158
context ->
159
159
context .put (
160
160
ReceiverContext .class ,
@@ -200,12 +200,12 @@ public final Flux<Message> listen() {
200
200
201
201
@ Override
202
202
public Mono <Void > send (Address address , Message message ) {
203
- return Mono .deferContextual (context -> connections .computeIfAbsent (address , this ::connect0 ))
203
+ return Mono .deferWithContext (context -> connections .computeIfAbsent (address , this ::connect0 ))
204
204
.flatMap (
205
205
connection ->
206
- Mono .deferContextual (context -> sender .send (message ))
207
- .contextWrite (context -> context .put (Connection .class , connection )))
208
- .contextWrite (
206
+ Mono .deferWithContext (context -> sender .send (message ))
207
+ .subscriberContext (context -> context .put (Connection .class , connection )))
208
+ .subscriberContext (
209
209
context ->
210
210
context .put (
211
211
SenderContext .class , new SenderContext (loopResources , this ::toByteBuf )));
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ final class TcpReceiver implements Receiver {
19
19
20
20
@ Override
21
21
public Mono <DisposableServer > bind () {
22
- return Mono .deferContextual (context -> Mono .just (context .get (ReceiverContext .class )))
22
+ return Mono .deferWithContext (context -> Mono .just (context .get (ReceiverContext .class )))
23
23
.flatMap (
24
24
context ->
25
25
newTcpServer (context )
Original file line number Diff line number Diff line change @@ -21,14 +21,14 @@ final class TcpSender implements Sender {
21
21
22
22
@ Override
23
23
public Mono <Connection > connect (Address address ) {
24
- return Mono .deferContextual (context -> Mono .just (context .get (SenderContext .class )))
24
+ return Mono .deferWithContext (context -> Mono .just (context .get (SenderContext .class )))
25
25
.map (context -> newTcpClient (context , address ))
26
26
.flatMap (TcpClient ::connect );
27
27
}
28
28
29
29
@ Override
30
30
public Mono <Void > send (Message message ) {
31
- return Mono .deferContextual (
31
+ return Mono .deferWithContext (
32
32
context -> {
33
33
Connection connection = context .get (Connection .class );
34
34
SenderContext senderContext = context .get (SenderContext .class );
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ final class WebsocketReceiver implements Receiver {
24
24
25
25
@ Override
26
26
public Mono <DisposableServer > bind () {
27
- return Mono .deferContextual (context -> Mono .just (context .get (ReceiverContext .class )))
27
+ return Mono .deferWithContext (context -> Mono .just (context .get (ReceiverContext .class )))
28
28
.flatMap (
29
29
context ->
30
30
newHttpServer (context )
Original file line number Diff line number Diff line change @@ -23,14 +23,14 @@ final class WebsocketSender implements Sender {
23
23
24
24
@ Override
25
25
public Mono <Connection > connect (Address address ) {
26
- return Mono .deferContextual (context -> Mono .just (context .get (SenderContext .class )))
26
+ return Mono .deferWithContext (context -> Mono .just (context .get (SenderContext .class )))
27
27
.map (context -> newWebsocketSender (context , address ))
28
28
.flatMap (sender -> sender .uri ("/" ).connect ());
29
29
}
30
30
31
31
@ Override
32
32
public Mono <Void > send (Message message ) {
33
- return Mono .deferContextual (
33
+ return Mono .deferWithContext (
34
34
context -> {
35
35
Connection connection = context .get (Connection .class );
36
36
SenderContext senderContext = context .get (SenderContext .class );
You can’t perform that action at this time.
0 commit comments