Show / Hide Table of Contents

Class Watcher<T>

Inheritance
object
Watcher<T>
Implements
IDisposable
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: k8s
Assembly: KubernetesClient.dll
Syntax
public class Watcher<T> : IDisposable
Type Parameters
Name Description
T

Constructors

Watcher(Func<Task<StreamReader>>, Action<WatchEventType, T>, Action<Exception>, Action)

Initializes a new instance of the Watcher<T> class.

Declaration
public Watcher(Func<Task<StreamReader>> streamReaderCreator, Action<WatchEventType, T> onEvent, Action<Exception> onError, Action onClosed = null)
Parameters
Type Name Description
Func<Task<StreamReader>> streamReaderCreator

A StreamReader from which to read the events.

Action<WatchEventType, T> onEvent

The action to invoke when the server sends a new event.

Action<Exception> onError

The action to invoke when an error occurs.

Action onClosed

The action to invoke when the server closes the connection.

Watcher(Func<Task<TextReader>>, Action<WatchEventType, T>, Action<Exception>, Action)

Initializes a new instance of the Watcher<T> class.

Declaration
public Watcher(Func<Task<TextReader>> streamReaderCreator, Action<WatchEventType, T> onEvent, Action<Exception> onError, Action onClosed = null)
Parameters
Type Name Description
Func<Task<TextReader>> streamReaderCreator

A TextReader from which to read the events.

Action<WatchEventType, T> onEvent

The action to invoke when the server sends a new event.

Action<Exception> onError

The action to invoke when an error occurs.

Action onClosed

The action to invoke when the server closes the connection.

Properties

Watching

indicate if the watch object is alive

Declaration
public bool Watching { get; }
Property Value
Type Description
bool

Methods

Dispose()

Declaration
public void Dispose()

Dispose(bool)

Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
bool disposing

Events

OnClosed

The event which is raised when the server closes the connection.

Declaration
public event Action OnClosed
Event Type
Type Description
Action

OnError

add/remove callbacks when any exception was caught during watching

Declaration
public event Action<Exception> OnError
Event Type
Type Description
Action<Exception>

OnEvent

add/remove callbacks when any event raised from api server

Declaration
public event Action<WatchEventType, T> OnEvent
Event Type
Type Description
Action<WatchEventType, T>

Implements

IDisposable
In this article
Back to top Generated by DocFX