Wait for an Assist Result (LCC.assist.wait)
Declaration
result, err, task = LCC.assist.wait(id, timeout?, pollIntervalMs?)
Parameters
- id
String. Assist request ID. - timeout
Number, optional. Wait timeout in seconds. Defaults to300. - pollIntervalMs
Number, optional. Polling interval in milliseconds. Defaults to1000; values below250are clamped to250.
Return Values
- result
Table ornil. Submitted result when the task reachessubmitted. - err
String ornil. Failure reason. - task
Table ornil. The latest task state.
Notes
Polls the control center until the task is submitted, cancelled, expired, not found, or timed out locally.
On local timeout, the SDK attempts to cancel the request and returnsnil, "timeout", task.
Onlysubmittedreturns aresult.
Example
local result, err, task = LCC.assist.wait("assist_xxx", 300, 1000)
if result then
nLog("assist completed")
else
nLog("assist failed", err, task and task.status)
end