Struct kube::runtime::Informer[][src]

pub struct Informer<K> where
    K: Clone + DeserializeOwned + Meta
{ /* fields omitted */ }
👎 Deprecated since 0.38.0:

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]

pub fn new(api: Api<K>) -> Self[src]

👎 Deprecated since 0.38.0:

Replaced by the kube-runtime crate

Create an informer on an api resource

pub fn params(self, lp: ListParams) -> Self[src]

👎 Deprecated since 0.38.0:

Replaced by the kube-runtime crate

Modify the default watch parameters for the underlying watch

pub fn set_version(self, v: String) -> Self[src]

👎 Deprecated since 0.38.0:

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]

👎 Deprecated since 0.38.0:

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]

👎 Deprecated since 0.38.0:

Replaced by the kube-runtime crate

Return the current version

pub async fn poll(&self) -> Result<impl Stream<Item = Result<WatchEvent<K>>>>[src]

👎 Deprecated since 0.38.0:

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

impl<K: Clone> Clone for Informer<K> where
    K: Clone + DeserializeOwned + Meta
[src]

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

impl<K> !UnwindSafe for Informer<K>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,