23.62. Class Heart
Namespace: ArmoniK.Core.Adapters.Nats
Assembly: ArmoniK.Core.Adapters.Nats.dll
Represents a heartbeat mechanism that executes a specified function at regular intervals.
public class Heart
23.62.1. Inheritance
23.62.2. Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
23.62.3. Constructors
23.62.3.1. Heart(Func<CancellationToken, Task>, TimeSpan, CancellationToken)
The function to execute at each beat It returns a predicate indicating if the heart must continue beating Defines the timespan between two heartbeatspublic Heart(Func<CancellationToken, Task> pulse, TimeSpan beatPeriod, CancellationToken cancellationToken = default)
23.62.3.1.1. Parameters
pulse Func<CancellationToken, Task>
beatPeriod TimeSpan
cancellationToken CancellationToken
23.62.4. Methods
23.62.4.1. Start()
Start the heart. If the heart is beating, it has no effect.
public void Start()
23.62.4.2. Stop()
Stops the heart
public Task Stop()
23.62.4.2.1. Returns
A task finishing with the last heartbeat