Cyclium.WorkClaims.Heartbeat (Cyclium v0.1.5)

Copy Markdown

Periodically renews a work claim lease while an episode is executing.

Started by EpisodeTask after a successful claim acquisition, and stopped when the episode completes or fails. The renewal interval defaults to lease_seconds / 3 to ensure the lease stays alive with margin for transient delays.

Crash resilience

The heartbeat is linked to the calling process (EpisodeTask). If the heartbeat crashes, the EpisodeTask receives an EXIT and restarts it. If the EpisodeTask crashes, the heartbeat dies with it. This ensures the heartbeat lifecycle is always tied to the episode execution.

Options

  • :dedupe_key — the claimed dedupe key (required)
  • :owner_node — the node that holds the claim (required)
  • :lease_seconds — lease duration for renewals (required)
  • :interval_ms — renewal interval in ms (default: lease_seconds * 1000 / 3)

Summary

Functions

Returns a specification to start this module under a supervisor.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(opts)

stop(pid)