Open Jmathieu3289 opened 3 years ago
@Jmathieu3289 can you assign to me?
@cunhazera - it is yours.
Please keep in mind to update the documentation and ideally add a test for the functionality.
I would love to see this approach implemented:
List<AgencySiteBlogLanding> blogHomepages = deliveryClient.getItems(AgencySiteBlogLanding.class).toSync();
I am still thinking, what is the best approach for the SDK to allow custom logging logic in case of failure so that this toSync
method does not have the logging hardcoded via system error output.
what do you think @Jmathieu3289?
@Simply007 here is the PR: https://github.com/Kentico/kontent-java-packages/pull/112
Do you know why this repo is invalid for hacktoberfest?
@cunhazera,
you could check the reason on your profile on https://hacktoberfest.digitalocean.com/profile.
There have been a bunch of anti-spam initiatives this year. If there is anything I can help you to covert the pull request to a valid one, I am happy to do so. This is a normal and valid contribution if everything does well.
I will comment on implementation in the pull request.
@Simply007 I think you need to add the "hacktoberfest" topic.
Thanks for the review, I'll check it out
Added "hacktoberfest" topic.
Motivation
After updating a large application to the latest version of the Java SDK, all calls to the DeliveryClient had to wrapped in a synchronous wrapper. It would be helpful if there were a built-in way to call the DeliveryClient synchronously rather than introducing additional code to the project.
Proposed solution
Add alternate methods for working with the DeliveryClient synchronously, for example:
deliveryClient.getItems().toSync()
ordeliveryClient.getItemsSynchronously()
Additional context
Here is the wrapper class that I had to write:
An example call using the wrapper:
An ideal way to use the DeliveryClient