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

biz.paluch.logging.gelf.intern.sender.ConstantBackOff Maven / Gradle / Ivy

The newest version!
package biz.paluch.logging.gelf.intern.sender;

import java.util.concurrent.TimeUnit;

/**
 * Constant {@link BackOff} implementation.
 *
 * @author Mark Paluch
 */
class ConstantBackOff implements BackOff, BackOffExecution {

    private final long backoffTimeMs;

    public ConstantBackOff(long backoffTime, TimeUnit timeUnit) {
        this.backoffTimeMs = timeUnit.toMillis(backoffTime);
    }

    @Override
    public long nextBackOff() {
        return backoffTimeMs;
    }

    @Override
    public BackOffExecution start() {
        return this;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy