File tree Expand file tree Collapse file tree 2 files changed +14
-10
lines changed
src/test/scala/gopher/channels Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Original file line number Diff line number Diff line change 1
1
2
2
- added append and flatMap operation for inputs.
3
3
- added Sieve to set of examples
4
- - implemented fold over selector. example:
4
+ - implemented fold over selector.
5
5
- implemented EffectedInput/EffectedOutput
6
6
(more detailed about fold over selected and Effected pattern can
7
7
be readed at https://github.com/rssh/notes/blob/master/2016_03_05_see-ma-no-vars.md )
8
8
- akka 2.4.2
9
+ - channels by defaults now unbuffered. (as in Go)
9
10
10
11
Original file line number Diff line number Diff line change @@ -20,21 +20,24 @@ class UnbufferedSelectSuite extends FunSuite with AsyncAssertions
20
20
21
21
test(" write without read must block " ) {
22
22
import gopherApi ._
23
- val channel1 = makeChannel[Int ](0 )
24
- val w1 = channel1.awrite(1 )
23
+ for (i <- 0 until 100 ) {
24
+ val channel1 = makeChannel[Int ](0 )
25
+ val w1 = channel1.awrite(1 )
25
26
26
- assert(! w1.isCompleted)
27
+ assert(! w1.isCompleted)
27
28
28
- val r1 = channel1.aread
29
+ val r1 = channel1.aread
29
30
30
- Await .ready(r1, 10 seconds)
31
+ Await .ready(w1, 10 seconds)
32
+ Await .ready(r1, 10 seconds)
31
33
32
- assert(w1.isCompleted)
33
- assert(r1.isCompleted)
34
+ assert(w1.isCompleted)
35
+ assert(r1.isCompleted)
34
36
35
- val rd = Await .result(r1, 10 seconds)
37
+ val rd = Await .result(r1, 10 seconds)
38
+ assert(rd== 1 )
39
+ }
36
40
37
- assert(rd== 1 )
38
41
}
39
42
40
43
test(" fold over selector with one-direction flow" ) {
You can’t perform that action at this time.
0 commit comments