@@ -11,8 +11,7 @@ It enables following symmetric interaction models:
1111* request/response (stream of 1)
1212* request/stream (finite/infinite stream of many)
1313* channel (bi-directional streams)
14-
15- Also, metadata can be associated with stream or RSocket itself
14+ * per-stream and per-RSocket metadata
1615
1716## Build and Binaries
1817
@@ -29,7 +28,7 @@ Also, metadata can be associated with stream or RSocket itself
2928 }
3029```
3130### Transports
32- ` Netty ` based Websockets and TCP transport (` Client ` and ` Server ` )
31+ ` Netty ` based Websockets and TCP transport (` Client ` and ` Server ` )
3332` OkHttp ` based Websockets transport (` Client ` only)
3433``` groovy
3534 dependencies {
@@ -44,22 +43,26 @@ Messages for all interactions are represented as `Payload` of binary (`NIO Byte
4443
4544UTF-8 ` text ` payloads can be constructed as follows
4645``` kotlin
47- val request = PayloadImpl .textPayload (" data" , " metadata" )
46+ val request = DefaultPayload .text (" data" , " metadata" )
4847```
4948Stream Metadata is optional
5049``` kotlin
51- val request = PayloadImpl .textPayload (" data" )
50+ val request = DefaultPayload .text (" data" )
5251```
5352#### Interactions
54- Fire and Forget
53+ * Fire and Forget
5554 ` RSocket.fireAndForget(payload: Payload): Completable `
56- Request-Response
55+
56+ * Request-Response
5757 ` RSocket.requestResponse(payload: Payload): Single<Payload> `
58- Request-Stream
58+
59+ * Request-Stream
5960 ` RSocket.requestStream(payload: Payload): Flowable<Payload> `
60- Request-Channel
61+
62+ * Request-Channel
6163 ` RSocket.requestChannel(payload: Publisher<Payload>): Flowable<Payload> `
62- Metadata-Push
64+
65+ * Metadata-Push
6366 ` fun metadataPush(payload: Payload): Completable `
6467
6568#### Client
@@ -75,13 +78,13 @@ val request = PayloadImpl.textPayload("data")
7578 private fun handler (requester : RSocket ): RSocket {
7679 return object : AbstractRSocket () {
7780 override fun requestStream (payload : Payload ): Flowable <Payload > {
78- return Flowable .just(PayloadImpl .textPayload (" client handler response" ))
81+ return Flowable .just(DefaultPayload .text (" client handler response" ))
7982 }
8083 }
8184 }
8285```
8386#### Server
84- Accepts ` Connections ` from ` Clients `
87+ Server is acceptor of ` Connections ` from ` Clients `
8588``` kotlin
8689val closeable: Single <Closeable > = RSocketFactory
8790 .receive()
@@ -93,7 +96,7 @@ val closeable: Single<Closeable> = RSocketFactory
9396private fun handler (setup : Setup , rSocket : RSocket ): Single <RSocket > {
9497 return Single .just(object : AbstractRSocket () {
9598 override fun requestStream (payload : Payload ): Flowable <Payload > {
96- return Flowable .just(PayloadImpl .textPayload (" server handler response" ))
99+ return Flowable .just(DefaultPayload .text (" server handler response" ))
97100 }
98101 })
99102 }
0 commit comments