meilisearch-php icon indicating copy to clipboard operation
meilisearch-php copied to clipboard

Add `wait()` method to Task class

Open Strift opened this issue 11 months ago • 1 comments

Description

Add wait(int $timeoutInMs, int $intervalInMs) method to Task class.

Basic example

So instead of:

$task = $this->client->createIndex('new-index', ['primaryKey' => 'objectID']);
$task = $this->index->waitForTask($task->getTaskUid());

We could write:

$task = $this->client->createIndex('new-index', ['primaryKey' => 'objectID'])->wait();

Strift avatar May 14 '25 04:05 Strift

Added via https://github.com/meilisearch/meilisearch-php/pull/735/commits/aefc35dbc2b6db4c0a7bd3306a766ee080a0b176

norkunas avatar Jun 03 '25 12:06 norkunas