package com.atlassian.stash.internal.concurrent;

import com.atlassian.bitbucket.concurrent.BucketedExecutorSettings;
import com.atlassian.bitbucket.concurrent.ConcurrencyService;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.io.Serializable;

public interface InternalConcurrencyService extends ConcurrencyService {

    /**
     * Overridden to change return type to give internal classes access to {@link InternalBucketedExecutor} methods.
     */
    @Nullable
    <T extends Serializable> InternalBucketedExecutor<T> getBucketedExecutor(@Nonnull String name);

    /**
     * Overridden to change return type to give internal classes access to {@link InternalBucketedExecutor} methods.
     */
    @Nonnull
    @Override
    <T extends Serializable> InternalBucketedExecutor<T> getBucketedExecutor(@Nonnull String name,
                                                                             @Nonnull BucketedExecutorSettings<T> settings);
}
