Goyoo / node-k8s-client

kubernetes client of node.js
MIT License
164 stars 59 forks source link

Cancel function for Watch commands #12

Closed dkapanidis closed 8 years ago

dkapanidis commented 8 years ago

If a watch function is running, is there any way I can programmatically cancel the watch?

mmoonn2 commented 8 years ago

Please upgrade k8s module next using

var res = kubeapi.watch('watch/namespaces/default/pods', function(data){
    console.log(data)
}, function(err){
    console.log(err)
})

setTimeout(function() {
    res.emit('close')
}, 2000)
dkapanidis commented 8 years ago

Great, this works as expected