File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -25,22 +25,22 @@ class Broadcaster[A]
25
25
val sendc : Channel [A ] = makeChannel()
26
26
val quitc : Channel [Boolean ] = makeChannel()
27
27
28
- /*
29
- select.fold(makeChannel[Message[A]]) { (last,s) =>
28
+ select.afold(makeChannel[Message [A ]]()) { (last,s) =>
30
29
s match {
31
- case v: sendc.read =>
32
- val next = makeChannel[Message[A]]
33
- last <~ Message (next,v)
30
+ case v : sendc.read @ unchecked =>
31
+ val next = makeChannel[Message [A ]]()
32
+ last <~ ValueMessage (next,v)
34
33
next
35
- case r: listenc.read =>
34
+ case r : listenc.read @ unchecked =>
36
35
r <~ last
37
36
last
38
37
case q : quitc.read =>
39
- implicitly[FlowTermination[Unit]].doExit(() )
38
+ CurrentFlowTermination .exit(last )
40
39
}
41
40
}
42
- */
41
+
43
42
43
+ /*
44
44
go {
45
45
var last = makeChannel[Message[A]]()
46
46
for (s <- select.forever) {
@@ -58,6 +58,7 @@ class Broadcaster[A]
58
58
}
59
59
}
60
60
}
61
+ */
61
62
62
63
def alisten (): Future [Receiver [A ]] = go {
63
64
val c = makeChannel[Channel [Message [A ]]]()
You can’t perform that action at this time.
0 commit comments