@@ -11,8 +11,7 @@ It enables following symmetric interaction models:
11
11
* request/response (stream of 1)
12
12
* request/stream (finite/infinite stream of many)
13
13
* channel (bi-directional streams)
14
-
15
- Also, metadata can be associated with stream or RSocket itself
14
+ * per-stream and per-RSocket metadata
16
15
17
16
## Build and Binaries
18
17
@@ -29,7 +28,7 @@ Also, metadata can be associated with stream or RSocket itself
29
28
}
30
29
```
31
30
### Transports
32
- ` Netty ` based Websockets and TCP transport (` Client ` and ` Server ` )
31
+ ` Netty ` based Websockets and TCP transport (` Client ` and ` Server ` )
33
32
` OkHttp ` based Websockets transport (` Client ` only)
34
33
``` groovy
35
34
dependencies {
@@ -44,22 +43,26 @@ Messages for all interactions are represented as `Payload` of binary (`NIO Byte
44
43
45
44
UTF-8 ` text ` payloads can be constructed as follows
46
45
``` kotlin
47
- val request = PayloadImpl .textPayload (" data" , " metadata" )
46
+ val request = DefaultPayload .text (" data" , " metadata" )
48
47
```
49
48
Stream Metadata is optional
50
49
``` kotlin
51
- val request = PayloadImpl .textPayload (" data" )
50
+ val request = DefaultPayload .text (" data" )
52
51
```
53
52
#### Interactions
54
- Fire and Forget
53
+ * Fire and Forget
55
54
` RSocket.fireAndForget(payload: Payload): Completable `
56
- Request-Response
55
+
56
+ * Request-Response
57
57
` RSocket.requestResponse(payload: Payload): Single<Payload> `
58
- Request-Stream
58
+
59
+ * Request-Stream
59
60
` RSocket.requestStream(payload: Payload): Flowable<Payload> `
60
- Request-Channel
61
+
62
+ * Request-Channel
61
63
` RSocket.requestChannel(payload: Publisher<Payload>): Flowable<Payload> `
62
- Metadata-Push
64
+
65
+ * Metadata-Push
63
66
` fun metadataPush(payload: Payload): Completable `
64
67
65
68
#### Client
@@ -75,13 +78,13 @@ val request = PayloadImpl.textPayload("data")
75
78
private fun handler (requester : RSocket ): RSocket {
76
79
return object : AbstractRSocket () {
77
80
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" ))
79
82
}
80
83
}
81
84
}
82
85
```
83
86
#### Server
84
- Accepts ` Connections ` from ` Clients `
87
+ Server is acceptor of ` Connections ` from ` Clients `
85
88
``` kotlin
86
89
val closeable: Single <Closeable > = RSocketFactory
87
90
.receive()
@@ -93,7 +96,7 @@ val closeable: Single<Closeable> = RSocketFactory
93
96
private fun handler (setup : Setup , rSocket : RSocket ): Single <RSocket > {
94
97
return Single .just(object : AbstractRSocket () {
95
98
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" ))
97
100
}
98
101
})
99
102
}
0 commit comments