You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-4
Original file line number
Diff line number
Diff line change
@@ -126,15 +126,19 @@ This bare bone approach to sending / receiving messages is focussed on the idea
126
126
127
127
### Streamed requests / responses (not final)
128
128
#### Clients
129
-
It's possible to stream content towards Sentinel clients by sending the `StreamedOperation` command to a Sentinel Client:
129
+
It's possible to stream content towards Sentinel clients by using the the `|~>>>` or `|>>>` functions on a Play *Enumerator* (after importing `nl.sentinel.client._`)
The function is annotated with the expected returning type (`TotalSize` in this case) and the type used within the `Enumerator` (`Chunk` in this case). The function takes a **Play 2** Enumerator as argument, which is folded to send each item to the TCP connection.
139
+
The content within the *Enumerator* is folded to send each item to the TCP connection (returning in the `Evt` type, defined through the pipeline).
136
140
137
-
#### Servers
141
+
#### Streaming Pipelines
138
142
To handle incoming streams, a `EnumeratorStage` is available in Sentinel. Initialisation of `EnumeratorStage` takes two arguments: `terminator: Evt ⇒ Boolean` and `includeTerminator: Boolean = false`.
139
143
140
144
This first argument is a function taking each `Evt` and returning a boolean in case the streamed chunk can be treated as a `EOS`. The second argument is used to declare if the terminator should be included in the eventual stream of content.
0 commit comments