Skip to content

Instantly share code, notes, and snippets.

@schmurfy
Created November 28, 2010 15:04
Show Gist options
  • Select an option

  • Save schmurfy/719001 to your computer and use it in GitHub Desktop.

Select an option

Save schmurfy/719001 to your computer and use it in GitHub Desktop.
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