All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.sphere.sdk.client.RetrySphereClientImpl Maven / Gradle / Ivy

There is a newer version: 2.16.0
Show newest version
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