26.67. 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
26.67.1. Inheritance
26.67.2. Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
26.67.3. Constructors
26.67.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)
26.67.3.1.1. Parameters
pulse Func<CancellationToken, Task>
beatPeriod TimeSpan
cancellationToken CancellationToken
26.67.4. Methods
26.67.4.1. Start()
Start the heart. If the heart is beating, it has no effect.
public void Start()
26.67.4.2. Stop()
Stops the heart
public Task Stop()
26.67.4.2.1. Returns
A task finishing with the last heartbeat