Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(client): Expose waitTask in the client #410

Merged
merged 2 commits into from
Jun 18, 2018

Conversation

julienbourdeau
Copy link

@julienbourdeau julienbourdeau commented Jun 14, 2018

Q A
Bug fix? no
New feature? yes
BC breaks? no
Need Doc update yes (not sure)

What was changed

2 methods about taskID initially available in the Index moved to the Client. The original methods on the index still work are not deprecated.

// New 🎉
$client->waitTask($indexName, $taskID, $timeBeforeRetry = 100, $requestHeaders = array())
$client->getTaskStatus($indexName, $taskID, $requestHeaders = array())

// Still available
$index->waitTask($taskID, $timeBeforeRetry = 100, $requestHeaders = array())
$index->getTaskStatus($taskID, $requestHeaders = array())

NOTE: The $timeBeforeRetry parameter is kept even if it doesn't exist in other clients. I believe it's a powerful feature.

Why it was changed

You could get some taskID from the engine without necessarily having an instance of Index. Instead of instantiating an index that you won't need, you can now call waitTask and getTaskStatus on the client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant