-
Notifications
You must be signed in to change notification settings - Fork 90
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
Improve TaskClient
, BatchClient
and associated types
#1825
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1825 +/- ##
==========================================
- Coverage 98.84% 98.15% -0.70%
==========================================
Files 17 18 +1
Lines 1565 1411 -154
Branches 338 289 -49
==========================================
- Hits 1547 1385 -162
- Misses 18 26 +8 ☔ View full report in Codecov by Sentry. |
TaskClient
, BatchClient
, associated types, and settings typesTaskClient
, BatchClient
and associated types
For some reason it's a lot slower, whereas it should be faster. I'll investigate. |
Okay, solved the slowness problem. Next, there's a lot of apply wait task. Should probably integrate it with http requests instead. |
Pull Request
What does this PR do?
Batch
,EnqueuedTask
andTask
*Object
equivalent objects, that come from the API responses, for the most part with the same exact properties and valuesDate
objects, but this functionality is also being removed, because:meilisearch
Rust source codeEnqueuedTaskObject
toEnqueuedTask
canceledBy
property as it doesn't existindexUid
property cannot beundefined
but can benull
BatchObject
toBatch
, adjust propertiesTaskObject
toTask
, adjust propertiesTask.details
had quite a few properties missing, likepagination
, now it's reusing theSettings
type, so we don't repeat ourselvesTaskClient
setInterval
getTask
requests sent until the previous one finishes (less spam, more efficient)EnqueuedTask
object as parameterwaitForTasks
can now accept an iterable instead of just an array as parameterwaitForTasksIter
, which is an asynchronous generator, that lazily awaits the tasksPromise<EnqueuedTask>
now instead returns anEnqueuedTaskPromise
Promise<EnqueuedTask>
with an extra methodwaitTask
, that first gets theEnqueuedTask
and then internally callsTaskClient.waitForTask
on it to return aPromise<Task>
, avoiding quite a bit of boilerplatePR checklist
Please check if your PR fulfills the following requirements:
Thank you so much for contributing to Meilisearch!
TODO: also create a new issue regarding testing and auto generating code samples