Class WatcherExt
Inherited Members
Namespace: k8s
Assembly: KubernetesClient.dll
Syntax
public static class WatcherExt
Methods
View SourceWatchAsync<T, L>(Task<HttpOperationResponse<L>>, Action<Exception>, CancellationToken)
create an IAsyncEnumerable from a call to api server with watch=true see https://docs.microsoft.com/en-us/archive/msdn-magazine/2019/november/csharp-iterating-with-async-enumerables-in-csharp-8
Declaration
[Obsolete("This method will be deprecated in future versions. Please use the WatchAsync method instead.")]
public static IAsyncEnumerable<(WatchEventType, T)> WatchAsync<T, L>(this Task<HttpOperationResponse<L>> responseTask, Action<Exception> onError = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| Task<HttpOperationResponse<L>> | responseTask | the api response |
| Action<Exception> | onError | a callback when any exception was caught during watching |
| CancellationToken | cancellationToken | cancellation token |
Returns
| Type | Description |
|---|---|
| IAsyncEnumerable<(WatchEventType, T)> | IAsyncEnumerable of watch events |
Type Parameters
| Name | Description |
|---|---|
| T | type of the event object |
| L | type of the HttpOperationResponse object |
Watch<T, L>(Task<HttpOperationResponse<L>>, Action<WatchEventType, T>, Action<Exception>, Action)
create a watch object from a call to api server with watch=true
Declaration
[Obsolete("This method will be deprecated in future versions. Please use the Watch method instead.")]
public static Watcher<T> Watch<T, L>(this Task<HttpOperationResponse<L>> responseTask, Action<WatchEventType, T> onEvent, Action<Exception> onError = null, Action onClosed = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Task<HttpOperationResponse<L>> | responseTask | the api response |
| Action<WatchEventType, T> | onEvent | a callback when any event raised from api server |
| Action<Exception> | onError | a callback when any exception was caught during watching |
| Action | onClosed | The action to invoke when the server closes the connection. |
Returns
| Type | Description |
|---|---|
| Watcher<T> | a watch object |
Type Parameters
| Name | Description |
|---|---|
| T | type of the event object |
| L | type of the HttpOperationResponse object |
Watch<T, L>(HttpOperationResponse<L>, Action<WatchEventType, T>, Action<Exception>, Action)
create a watch object from a call to api server with watch=true
Declaration
[Obsolete("This method will be deprecated in future versions. Please use the Watch method instead.")]
public static Watcher<T> Watch<T, L>(this HttpOperationResponse<L> response, Action<WatchEventType, T> onEvent, Action<Exception> onError = null, Action onClosed = null)
Parameters
| Type | Name | Description |
|---|---|---|
| HttpOperationResponse<L> | response | the api response |
| Action<WatchEventType, T> | onEvent | a callback when any event raised from api server |
| Action<Exception> | onError | a callback when any exception was caught during watching |
| Action | onClosed | The action to invoke when the server closes the connection. |
Returns
| Type | Description |
|---|---|
| Watcher<T> | a watch object |
Type Parameters
| Name | Description |
|---|---|
| T | type of the event object |
| L | type of the HttpOperationResponse object |