
io.sphere.sdk.client.RetrySphereClientImpl Maven / Gradle / Ivy
package io.sphere.sdk.client;
import io.sphere.sdk.retry.AsyncRetrySupervisor;
import io.sphere.sdk.retry.RetryRule;
import java.util.List;
import java.util.concurrent.CompletionStage;
final class RetrySphereClientImpl extends SphereClientDecorator {
private final AsyncRetrySupervisor supervisor;
RetrySphereClientImpl(final SphereClient delegate, final List retryRules) {
super(delegate);
this.supervisor = AsyncRetrySupervisor.of(retryRules);
}
@Override
public CompletionStage execute(final SphereRequest sphereRequest) {
return supervisor.supervise(this, super::execute, sphereRequest);
}
@Override
public void close() {
supervisor.close();
super.close();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy