What worked: function bloop(size; write_size=100000) data = Array{UInt8}("f" ^ size)
println("start") (pout, pin, p) = readandwrite(`cat -`) println("read") read_task = @async read(pout) for chunk in chunks(data, write_size) println("write") write(pin, chunk) end println("close") close(pin) println("collect read data") output = wait(read_task) println("close") close(p) println() output end