I can't find too much documentation on pipes. Shou...
# squarelibraries
p
I can't find too much documentation on pipes. Shouldn't this print values?
Copy code
@Test
    fun pipe() {
        val pipe = Pipe(Long.MAX_VALUE)

        thread {
            val sink = pipe.sink.buffer()
            repeat(10){i ->
                Thread.sleep(1000)
                sink.writeInt(i)
            }
        }

        val source = pipe.source.buffer()
        while (true) {
            println(source.readInt())
        }
    }