Struct kube::runtime::Informer [−][src]
Replaced by kube_runtime::watcher
An event informer for a Kubernetes [‘Api’] resource
This observes events on an Api<K>
and tracks last seen versions.
As per the kubernetes documentation, this is an abstraction that can
efficiently detect changes
In the case where kubernetes returns 410 Gone (desynced / watched for too long) this object will reset the informer ensuring that it always keeps running.
This means that you might occasionally get some duplicate added events, but we have configured timeouts such that this should not happen frequently.
On boot, the initial watch causes added events for every currently live object.
Because of https://github.com/clux/kube-rs/issues/219 we recommend you use this with kubernetes >= 1.16 and watch bookmarks enabled.
Implementations
impl<K> Informer<K> where
K: Clone + DeserializeOwned + Meta,
[src]
K: Clone + DeserializeOwned + Meta,
pub fn new(api: Api<K>) -> Self
[src]
Replaced by the kube-runtime crate
Create an informer on an api resource
pub fn params(self, lp: ListParams) -> Self
[src]
Replaced by the kube-runtime crate
Modify the default watch parameters for the underlying watch
pub fn set_version(self, v: String) -> Self
[src]
Replaced by the kube-runtime crate
Override the version to an externally tracked version
Prefer not using this. Even if you track previous resource versions, you will miss deleted events if you have any downtime.
Controllers/finalizers/ownerReferences are the preferred ways to garbage collect related resources.
pub async fn reset(&self)
[src]
Replaced by the kube-runtime crate
Reset the resourceVersion to 0
This will trigger new Added events for all existing resources
pub fn version(&self) -> String
[src]
Replaced by the kube-runtime crate
Return the current version
pub async fn poll(&self) -> Result<impl Stream<Item = Result<WatchEvent<K>>>>
[src]
Replaced by the kube-runtime crate
Start a single watch stream
Opens a long polling GET and returns a stream of WatchEvents. You should always poll. When this call ends, call it again. Do not call it from more than one context.
All real errors are bubbled up, as are WachEvent::Error instances. If we are desynced we force a 10s wait 10s before starting the poll.
If you need to track the resourceVersion
you can use Informer::version()
.
Trait Implementations
Auto Trait Implementations
impl<K> !RefUnwindSafe for Informer<K>
impl<K> Send for Informer<K>
impl<K> Sync for Informer<K>
impl<K> Unpin for Informer<K> where
K: Unpin,
K: Unpin,
impl<K> !UnwindSafe for Informer<K>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,