GenDurable.Queries (gen_durable v0.1.2)

Copy Markdown View Source

Every database statement from spec §10, one function each, as raw SQL.

All functions take the repo explicitly. The complete_* functions run the outcome UPDATE and the consumed-signal DELETE in one transaction. partition_key serialization (advisory lock) helpers live here too; the caller is responsible for holding a single connection (Repo.checkout/1) for the lock's lifetime.

Summary

Functions

advisory_try_lock(repo, key)

advisory_unlock(repo, key)

complete_await(repo, id, state_json, signal_name)

complete_done(repo, id, result_json)

complete_next(repo, id, step, state_json)

complete_replay(repo, id, state_json, delay_ms)

complete_schedule_childs(repo, parent_id, next_step, state_json, children)

complete_stop(repo, id, reason_text)

deliver_signal(repo, target_id, name, payload_json, dedup_key)

heartbeat(repo, ids, worker, lease_ttl_ms)

insert(repo, p)

insert_all(repo, rows)

load_childs(repo, parent_id)

load_signals(repo, target_id)

pick(repo, queue, batch, worker, lease_ttl_ms)

reap(repo)

release(repo, ids, worker)

reset_to_runnable(repo, id)