Blocking polling for Logpoint searches.
The Logpoint search API is asynchronous — submit a query, then poll for
results. run/3 handles the polling loop, including resubmitting expired
searches automatically.
Summary
Functions
Run a search and block until final results arrive.
Functions
@spec run(LogpointApi.Data.Client.t(), LogpointApi.Data.SearchParams.t(), keyword()) :: {:ok, map()} | {:error, term()}
Run a search and block until final results arrive.
Polls Search.get_result/2 until the response contains "final" => true.
When the API returns "success" => false (expired search), the original
query is resubmitted automatically.
Options
:polling_interval— milliseconds between polls (default:1000):max_attempts— maximum poll iterations (default:30)
Examples
{:ok, result} = SearchRunner.run(client, query)
{:ok, result} = SearchRunner.run(client, query, polling_interval: 2_000, max_attempts: 30)