Click or drag to resize

ActivityHeartbeatAsync Method

Used to record heartbeats at a specific interval.

Namespace:  Neon.Cadence
Assembly:  Neon.Cadence (in Neon.Cadence.dll) Version: 2.14.0
public Task<bool> HeartbeatAsync(
	Func<byte[]> detailsFunc = null,
	Nullable<TimeSpan> interval = null


detailsFunc (Optional)
Type: SystemFuncByte
Optionally specifies a function that returns the heartbeat details.
interval (Optional)
Type: SystemNullableTimeSpan
Optionally specifies the interval between heartbeats. This defaults to 1/2 of activity's heartbeat timeout.

Return Value

Type: TaskBoolean
true if a heartbeat was recorded.

This is a convienence method that can be used to make it easy to restrict how often activity heartbeats are actually recorded. The activity can call this as often as it likes but the method schedules heartbeat times and only transmits a heartbeat when this time has been reached.

By default, the method records heartbeats at 1/2 the activity's heartbeat timeout, but this can be customized via the interval parameter. No heartbeat details will be recorded by default, but you can customize this by passing a detailsFunc.

Note Note
Any detailsFunc passed will only be called when a heartbeat is scheduled.
See Also