-
Notifications
You must be signed in to change notification settings - Fork 119
/
IApplicationStatusProvider.cs
29 lines (26 loc) · 1.34 KB
/
IApplicationStatusProvider.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
namespace DotNext.Diagnostics;
/// <summary>
/// Represents probes for the application running inside of Kubernetes.
/// </summary>
/// <seealso href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes">Kubernetes Probes</seealso>
public interface IApplicationStatusProvider
{
/// <summary>
/// Implements Readiness probe.
/// </summary>
/// <param name="token">The token that can be used to cancel the operation.</param>
/// <returns><see langword="true"/> if probe is successful; otherwise, <see langword="false"/>.</returns>
Task<bool> ReadinessProbeAsync(CancellationToken token) => Task.FromResult(true);
/// <summary>
/// Implements Liveness probe.
/// </summary>
/// <param name="token">The token that can be used to cancel the operation.</param>
/// <returns><see langword="true"/> if probe is successful; otherwise, <see langword="false"/>.</returns>
Task<bool> LivenessProbeAsync(CancellationToken token);
/// <summary>
/// Implements Startup probe.
/// </summary>
/// <param name="token">The token that can be used to cancel the operation.</param>
/// <returns><see langword="true"/> if probe is successful; otherwise, <see langword="false"/>.</returns>
Task<bool> StartupProbeAsync(CancellationToken token) => Task.FromResult(true);
}