Skip to content

Instantly share code, notes, and snippets.

@schmurfy
Created Nov 28, 2010
Embed
What would you like to do?
LUA collectd examples
-- (implemntation ~ 100 lines of C code)
-- first way
function my_callback1()
dispatch_values(...)
end
function my_callback2()
dispatch_values(...)
dispatch_values(...)
end
lua_cb_register_read("my_callback1")
lua_cb_register_read("my_callback2")
-- second way
lua_cb_register_read(function()
-- do something
dispatch_values(...)
end)
-- (implemntation ~ 20 lines of C code)
-- firstand only way
function cb_read()
dispatch_values(...)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment