Gust.Run.Claim behaviour (gust v0.1.26)

Behavior + facade for claiming/renewing run leases.

Configure the implementation with:

config :gust, Gust.Run.Claim, Gust.Run.Claim.Repo

Summary

Types

next_run_result()

@type next_run_result() ::
  nil
  | %{
      run: run(),
      token: token(),
      claimed_by: String.t(),
      claim_expires_at: DateTime.t()
    }

run()

@type run() :: Gust.Flows.Run.t()

run_id()

@type run_id() :: term()

token()

@type token() :: Ecto.UUID.t()

Callbacks

next_run()

@callback next_run() :: next_run_result()

renew_run(run_id, token)

@callback renew_run(run_id(), token()) :: run() | nil

Functions

next_run()

renew_run(run_id, token)