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(java): waitForTask APIC-478 #521

Merged
merged 3 commits into from
May 20, 2022
Merged

feat(java): waitForTask APIC-478 #521

merged 3 commits into from
May 20, 2022

Conversation

millotp
Copy link
Collaborator

@millotp millotp commented May 19, 2022

🧭 What and Why

🎟 JIRA Ticket: APIC-478

Add the waitForTask util for the search client, and make it generic if we want to use for other task.
I modified the maxTrials and timeout based on test, it can up a lot more that 1 seconds to delete a single object.

🧪 Test

There is no test for the waitTask yet, I will integrate with the incoming client test, but it's tested in the playground.

@millotp millotp self-assigned this May 19, 2022
@netlify
Copy link

netlify bot commented May 19, 2022

Deploy Preview for api-clients-automation canceled.

Name Link
🔨 Latest commit 9ad8c27
🔍 Latest deploy log https://app.netlify.com/sites/api-clients-automation/deploys/628763a0d38e5d0008521c30

@algolia-bot
Copy link
Collaborator

algolia-bot commented May 19, 2022

✗ The generated branch has been deleted.

If the PR has been merged, you can check the generated code on the main branch.
You can still access the code generated on main via this commit.

@millotp millotp requested review from a team, damcou and shortcuts and removed request for a team May 19, 2022 16:01
Copy link
Member

@shortcuts shortcuts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking greatooo

@@ -216,5 +216,19 @@ public class {{classname}} extends ApiClient {
}
{{/optionalParams.0}}
{{/operation}}

{{#isSearchClient}}
public void waitForTask(String indexName, Long taskID, RequestOptions requestOptions) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we allow option overriding like we did for JS? This way people don't have to re-implement the function

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep I can add a variant

import java.util.function.Predicate;
import java.util.function.Supplier;

public class TaskUtils {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could maybe add the defaults at the class level? So we don't have to dig if we want to change it somedays

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did the same as for js, do you want me to change it there too ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep a constant at the top of the file maybe?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry you mean putting the default in the search client or just at the top of this file?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the top of this file, the default value options (same for JS maybe?)

shortcuts
shortcuts previously approved these changes May 20, 2022
Copy link
Member

@shortcuts shortcuts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really clean!!

@millotp
Copy link
Collaborator Author

millotp commented May 20, 2022

The generation said nope ahah

Copy link
Member

@shortcuts shortcuts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

purrfect now!

@millotp millotp merged commit 1ba6c86 into main May 20, 2022
@millotp millotp deleted the feat/java-waitForTask branch May 20, 2022 09:59
@shortcuts shortcuts mentioned this pull request May 23, 2022
3 tasks
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.

3 participants