Skip to content
Snippets Groups Projects
Commit d2a7b2a3 authored by Marek Vavruša's avatar Marek Vavruša
Browse files

modules/ketcd: added polling

parent 3fcc86cb
No related branches found
No related tags found
No related merge requests found
......@@ -39,11 +39,17 @@ function ketcd.config(conf)
if type(conf) == 'table' then
for k,v in pairs(conf) do options[k] = v end
end
-- create connection
local cli, err = ketcd.Etcd.new(options)
if err then
error(err)
end
ketcd.cli = cli
-- schedule recurrent polling
-- @todo: the etcd has watch() API, but this requires
-- coroutines on socket operations
if ketcd.ev then event.cancel(ketcd.ev) end
ketcd.ev = event.recurrent(5 * sec, ketcd.reload)
end
return ketcd
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment