Closed louiekwan closed 8 years ago
Try a few ways to set the options, only work if key is a property but not a directory.
Nothing get return, if I make changes under the directory under monitor
var dir = '/' var options = {wait: true,recursive: true}; var watcher = etcd.watcher(dir, options);
watcher .on('set', function (data) { console.log('data: ', data); }) .on('change', function (data) { console.log('data: ', data); }) .on('expire', function (data) { console.log('Value expired.'); console.log('data: ', data); }) .on('delete', function (data) { console.log('Value deleted.'); console.log('data: ', data); });
@louiekwan Did you find anyway to do that? I'd like to watch changes with directory too.
Try a few ways to set the options, only work if key is a property but not a directory.
Nothing get return, if I make changes under the directory under monitor
var dir = '/' var options = {wait: true,recursive: true}; var watcher = etcd.watcher(dir, options);
watcher .on('set', function (data) { console.log('data: ', data); }) .on('change', function (data) { console.log('data: ', data); }) .on('expire', function (data) { console.log('Value expired.'); console.log('data: ', data); }) .on('delete', function (data) { console.log('Value deleted.'); console.log('data: ', data); });