Skip to main content

run_in_isolated_tx_with_retries

Function run_in_isolated_tx_with_retries 

pub async fn run_in_isolated_tx_with_retries<F, Fut, T>(
    pool: &Pool<Postgres>,
    isolation: TransactionIsolation,
    max_retries: u32,
    body: F,
) -> Result<T, CratestackError>
where F: FnMut(Transaction<'static, Postgres>) -> Fut, Fut: Future<Output = Result<(T, Transaction<'static, Postgres>), CratestackError>>,
Expand description

Same as run_in_isolated_tx but with a caller-chosen retry budget. Banks running long-tail contended writes sometimes want a higher cap (5–10); single-row CAS workflows can drop to 1 to fail fast.