GenDurable.Queries (gen_durable v0.1.8)

Copy Markdown View Source

Every database statement, 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. concurrency_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, names, next_step)

complete_done(repo, id, result_json)

complete_next(repo, id, step, state_json, consumed_ids, rate_limit, weight)

complete_retry(repo, id, state_json, delay_ms)

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

complete_stop(repo, id, reason_text)

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

gc(repo, retention_ms, batch)

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)

upsert_rate_configs(repo, configs)