wait_operation

toloka.client.TolokaClient.wait_operation | Source code

wait_operation(
self,
op: Operation,
timeout: timedelta = ...,
disable_progress: bool = False
)

Waits for a Toloka operation to complete.

To get information about the operation, call the get_operation method.

Parameters description

ParametersTypeDescription
opOperation

The ID of the operation.

timeouttimedelta

The wait timeout.

Default value: 10 minutes.

disable_progressbool
  • False — A progress bar is shown.
  • True — A progress bar is hidden.

Default value: False.

  • Returns:

    The completed operation.

  • Return type:

    Operation

Examples:

The example starts aggregation and waits for it.

aggregation_operation = toloka_client.aggregate_solutions_by_pool(
type=toloka.client.aggregation.AggregatedSolutionType.WEIGHTED_DYNAMIC_OVERLAP,
pool_id='1086170',
answer_weight_skill_id='11294',
fields=[toloka.client.aggregation.PoolAggregatedSolutionRequest.Field(name='result')]
)
aggregation_operation = toloka_client.wait_operation(aggregation_operation)
aggregation_results = list(toloka_client.get_aggregated_solutions(aggregation_operation.id))

Last updated: August 28, 2023

Toloka-Kit
OverviewGetting API keyQuick start
Recipes
Reference
toloka.client
toloka.async_client
toloka.autoquality [autoquality]
toloka.metrics
toloka.streaming