Reflectors Vs Watchers #695
-
My intention is to get event notifications for whenever a, for eg,, To my question, for my purposes, I feel like a watcher is better suited? Correct me if I am wrong(also when should one use a reflector?). The examples for watchers and reflectors use Also is the very first event from a watcher a Restart event? It would make sense if it was :) Thanks again for your continued help :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Yes. Though not every disconnect generates a
It's hard to make a concrete recommendation without knowing what kind of action you're planning on taking based on those events. If in doubt, I'd go with
You don't have to use
Yes. |
Beta Was this translation helpful? Give feedback.
Yes. Though not every disconnect generates a
Restart
; we try to recover the existing stream first and onlyRestart
if that fails.kube-runtime
is a bit like a layer cake:kube::Api::watch
streams events from the Kubernetes APIkube_runtime::watcher
adds error recovery on top ofApi::watch
(as you've already noticed), use this if you only care about raw events (for example: logging all events as they happen)kube_runtime::reflector
adds …