Skip to content

Commit 508722b

Browse files
committed
Existence of select.exit(a) and select.shutdown() is reflected in documentation
1 parent 6cbf532 commit 508722b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ go{
202202
~~~
203203

204204

205-
Inside case actions, we can use blocking read/writes and await operations. Call of doExit in the implicit instance of `FlowTermination[T]` (for a forever loop this is `FlowTermination[Unit]`) can be used for exiting from the loop.
205+
Inside case actions, we can use blocking read/writes and await operations. Call of doExit in the implicit instance of `FlowTermination[T]` (for a forever loop this is `FlowTermination[Unit]`) can be used for exiting from the loop. `select.exit` and `selecet.shutdown` macroses can be used as shortcats.
206206

207207
Example:
208208

@@ -216,7 +216,7 @@ val consumer = gopherApi.select.forever{
216216
case i: channerl.read =>
217217
sum = sum + i
218218
if (i==1000) {
219-
implictily[FlowTermination[Unit]].doExit(())
219+
select.shutdown()
220220
}
221221
}
222222

@@ -231,7 +231,7 @@ val consumer = gopherApi.select.afold(0) { (state, selector) =>
231231
case i: channel.read =>
232232
val nstate = state + i
233233
if (i==1000) {
234-
implictily[FlowTermination[Int]].doExit(nstate)
234+
select.exit(nstate)
235235
}
236236
nstate
237237
}
@@ -245,7 +245,7 @@ val consumer = gopherApi.select.afold(0) { (state, selector) =>
245245
val fib = select.afold((0,1)) { case ((x,y), s) =>
246246
s match {
247247
case x:channel.write => (y,y+x)
248-
case q:quit.read => CurrentFlowTermination.exit((x,y))
248+
case q:quit.read => select.exit((x,y))
249249
}
250250
}
251251
~~~
@@ -286,7 +286,7 @@ go {
286286
val sum = select.fold(0) { (n,s) =>
287287
s match {
288288
case x: channelA.read => n+x
289-
case q: quit.read => CurrentFlowTermination.exit(n)
289+
case q: quit.read => select.exit(n)
290290
}
291291
}
292292
}

0 commit comments

Comments
 (0)