summaryrefslogtreecommitdiff
path: root/tests/modules/pipe/pipe_pair.lua
blob: de81a313381ce89dee63558b63ef929cbf74d611 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
import("core.base.pipe")

function main()
    local rpipe, wpipe = pipe.openpair(4096)
    wpipe:write("hello xmake!", {block = true})
    local read, data = rpipe:read(13)
    if read > 0 and data then
        data:dump()
    end
    rpipe:close()
    wpipe:close()
end