Skip to content

Instantly share code, notes, and snippets.

@cablehead
Created September 11, 2017 08:54
Show Gist options
  • Save cablehead/7b423cfa337a89f0e598a9679f98531a to your computer and use it in GitHub Desktop.
Save cablehead/7b423cfa337a89f0e598a9679f98531a to your computer and use it in GitHub Desktop.
local h = levee.Hub()
local r, w = h.io:pipe()
local len = 128*1024
local buf = d.Buffer(len)
print()
h:spawn(function()
local err = w:write(("X"):rep(len))
print(err)
w:close()
end)
while true do
local err, n = r:read(buf:tail())
if err then break end
buf:bump(n)
end
print(buf:value())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment