Created
November 28, 2010 15:04
-
-
Save schmurfy/719001 to your computer and use it in GitHub Desktop.
LUA collectd examples
This file contains 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
-- (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) |
This file contains 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
-- (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