File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,36 @@ Frames can be printed out to help debugging. Set the logger `io.rsocket.FrameLog
52
52
- Java 8 - heavy dependence on Java 8 functional APIs and java.time, also on Reactor
53
53
- Android O - https://github.com/rsocket/rsocket-demo-android-java8
54
54
55
+ ## Trivial Client
56
+
57
+ ```
58
+ package io.rsocket.transport.netty;
59
+
60
+ import io.rsocket.Payload;
61
+ import io.rsocket.RSocket;
62
+ import io.rsocket.RSocketFactory;
63
+ import io.rsocket.transport.netty.client.WebsocketClientTransport;
64
+ import io.rsocket.util.PayloadImpl;
65
+ import reactor.core.publisher.Flux;
66
+
67
+ import java.net.URI;
68
+
69
+ public class ExampleClient {
70
+ public static void main(String[] args) {
71
+ WebsocketClientTransport ws = WebsocketClientTransport.create(URI.create("ws://rsocket-demo.herokuapp.com/ws"));
72
+ RSocket client = RSocketFactory.connect().keepAlive().transport(ws).start().block();
73
+
74
+ try {
75
+ Flux<Payload> s = client.requestStream(PayloadImpl.textPayload("peace"));
76
+
77
+ s.take(10).doOnNext(p -> System.out.println(p.getDataUtf8())).blockLast();
78
+ } finally {
79
+ client.close().block();
80
+ }
81
+ }
82
+ }
83
+ ```
84
+
55
85
## Bugs and Feedback
56
86
57
87
For bugs, questions and discussions please use the [ Github Issues] ( https://github.com/RSocket/reactivesocket-java/issues ) .
You can’t perform that action at this time.
0 commit comments