taskID in the response.
The task runs separately, depending on the server load.
This helper method polls the Check task status API and stops if the task’s status is published.
Usage
var response = await client.WaitForTaskAsync("INDEX_NAME", 123L);
response, err := client.WaitForTask(
"INDEX_NAME", 123)
if err != nil {
// handle the eventual error
panic(err)
}
GetTaskResponse response = client.waitForTask("INDEX_NAME", 123L);
const response = await client.waitForTask({ indexName: 'wait-task-javascript', taskID: 123 });
var response = client.waitForTask(indexName = "INDEX_NAME", taskID = 123L)
$response = $client->waitForTask(
'INDEX_NAME',
123,
);
response = client.wait_for_task(
index_name="INDEX_NAME",
task_id=123,
)
response = client.wait_for_task("INDEX_NAME", 123)
val response = Await.result(
client.waitForTask(
indexName = "INDEX_NAME",
taskID = 123L
),
Duration(100, "sec")
)
let response = try await client.waitForTask(indexName: "INDEX_NAME", taskID: Int64(123))
Parameters
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
string
required
Index name where the task was executed.
long
required
Task ID to wait for.
int
default:50
Maximum number of retries for checking the status.
Func<int,int>
Returns a timeout based on the current number of iterations.
RequestOptions
Additional request options.
CancellationToken
default:"default"
Parameter that can be used as a signal to cancel this request.
string
required
Index name where the task was executed.
int
required
Task ID to wait for.
WaitParams
Hide child attributes
Hide child attributes
RequestOptions
Additional request options.
string
required
Index name where the task was executed.
int64
required
Task ID to wait for.
IterableOption
Functional options to provide extra arguments.
Show available functions
Show available functions
function
Signature:
func(maxRetries int) iterableOptionSets the maximum number of retries for this method.function
Signature:
func(count int) time.DurationReturns a timeout based on the current number of iterations.function
Signature:
func(key string, value string) requestOptionSets extra header parameters for this request.
To learn more, see request options.function
Signature:
func(key string, value string) requestOptionSets extra query parameters for this request.
To learn more, see request options.String
required
Index name where the task was executed.
long
required
Task ID to wait for.
int
default:50
Maximum number of retries for checking the status.
function
Default:
(int retries) -> Math.min(retries * 200, 5000)Returns the time between status checks based on the current number of iterations.
By default, the initial delay is 200 milliseconds.
With every iteration, the delay increases by 200 milliseconds,
until a maximum of 5 seconds is reached.RequestOptions
Additional request options.
string
required
Index name where the task was executed.
number
required
Task ID to wait for.
number
default:50
Maximum number of retries for checking the status.
function
Default:
(retryCount: number) -> Math.min(retryCount * 200, 5000)Returns the time between status checks based on the current number of iterations.
By default, the initial delay is 200 milliseconds.
With every iteration, the delay increases by 200 milliseconds,
until a maximum of 5 seconds is reached.RequestOptions
Additional request options.
String
required
Index name where the task was executed.
Long
required
Task ID to wait for.
int
default:50
Maximum number of retries for checking the status.
Duration
default:"200 ms"
Time after which the status is checked for the first time.
This time is doubled after every check until it reaches the value set by
maxDelay.Duration
default:"5 seconds"
Maximum time to wait between status checks.
RequestOptions
Additional request options.
string
required
Index name where the task was executed.
int
required
Task ID to wait for.
int
default:50
Maximum number of retries for checking the status.
int
default:5000
Number of milliseconds between status checks.
array
Additional request options.
str
required
Index name where the task was executed.
int
required
Task ID to wait for.
int
default:50
Maximum number of retries for checking the status.
Callable[[int], int]
Default:
min(retry_count*0.2, 5)Returns the time between status checks based on the current number of iterations.
By default, the initial delay is 200 milliseconds.
With every iteration, the delay increases by 200 milliseconds,
until a maximum of 5 seconds is reached.dict | RequestOptions
Additional request options.
String
required
Index name where the task was executed.
Integer
required
Task ID to wait for.
Integer
default:50
Maximum number of retries for checking the status.
function
Default:
[retry_count * 200, 5000].minReturns the time between status checks based on the current number of iterations.
By default, the initial delay is 200 milliseconds.
With every iteration, the delay increases by 200 milliseconds,
until a maximum of 5 seconds is reached.Hash
Additional request options.
String
required
Index name where the task was executed.
Long
required
Task ID to wait for.
int
default:50
Maximum number of retries for checking the status.
Long => Long
Default:
(retries: Long) => Math.min(retries * 200, 5000)Returns the time between status checks based on the current number of iterations.
By default, the initial delay is 200 milliseconds.
With every iteration, the delay increases by 200 milliseconds,
until a maximum of 5 seconds is reached.RequestOptions
Additional request options.
String
required
Index name where the task was executed.
Int64
required
Task ID to wait for.
int
default:50
Maximum number of retries for checking the status.
(int) -> TimeInterval
Default:
(retryCount) -> min(TimeInterval(retryCount) * 0.2, 5)Returns the time between status checks based on the current number of iterations.
By default, the initial delay is 200 milliseconds.
With every iteration, the delay increases by 200 milliseconds,
until a maximum of 5 seconds is reached.RequestOptions
Additional request options.