This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local levee = require("levee") | |
local _ = levee._ | |
local h = levee.Hub() | |
local r, w = h.io:pipe() | |
h:spawn(function() | |
for i = 1, 1000 do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local levee = require("levee") | |
local _ = levee._ | |
local h = levee.Hub() | |
local r, w = h.io:pipe() | |
h:spawn(function() | |
for i = 1, 1000 do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local levee = require("levee") | |
local _ = levee._ | |
local h = levee.Hub() | |
local r, w = h.io:pipe() | |
h:spawn(function() | |
for i = 1, 1000 do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local h = levee.Hub() | |
local r, w = h.io:pipe() | |
local len = 128*1024 | |
local buf = d.Buffer(len) | |
print() | |
h:spawn(function() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local h = levee.Hub() | |
local r, w = h.io:pipe() | |
h:spawn(function() | |
local err = w:write(("X"):rep(128*1024)) | |
print(err) | |
w:close() | |
end) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <assert.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
struct packet_t { | |
char uri[16]; | |
char key[16]; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local levee = require("levee") | |
local fsource = require('levix.source.file') | |
local h = levee.Hub() | |
local err, sources = fsource.watch(h, "./sources.json") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r:stream():line() --> `err`, `Slice` | |
-- a slice is a restricted `off`, `len` window into a buffer. offers all methods buffer does. | |
-- is bump / growable, if `len` extends to the end of the buffer's current contents. | |
-- this allows you to make use of the line without incurring and additional copy | |
-- you call `:trim` when done with the line. | |
-- buffer (and so slice) will get two new methods |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local ffi = require("ffi") | |
local levee = require("levee") | |
ffi.cdef([[ | |
typedef struct { int len; } myproto_prefix_t; | |
]]) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local ffi = require("ffi") | |
local levee = require("levee") | |
ffi.cdef([[ | |
typedef struct { int len; } myproto_prefix_t; | |
]]) | |