ExAzureCore.Lro (ex_azure_core v0.3.0)

Copy Markdown

Drives Azure long-running operations (status-monitor pattern) to completion.

Generated SDK operations that are long-running set their :poller to a closure that delegates here, so the polling logic lives (and is tested) in one place.

The flow: perform the initial request, read the status-monitor URL from a response header, poll it (honoring Retry-After) until the body's status property reaches a terminal state, then resolve the final result — either by GETting the original resource URI or from the terminal poll body.

Summary

Functions

Runs a long-running operation to completion.

Functions

run(config, initial_op, opts)

@spec run(map(), ExAzureCore.Operation.t(), keyword()) ::
  {:ok, term()} | {:error, term()}

Runs a long-running operation to completion.

Options

  • :status_path - response body key holding the status (default "status")
  • :succeeded / :failed / :canceled - terminal state values (defaults ["Succeeded"] / ["Failed"] / ["Canceled"])
  • :final - how to get the result after success: :original_uri (GET the original resource) or :poll_body (use the terminal status monitor body)
  • :decode - 1-arity function applied to the final result body
  • :delay_ms - fallback poll interval when no Retry-After header is present