<commit_before>/**
 * Copyright 2015 Netflix, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.reactivesocket.aeron.internal;

import uk.co.real_logic.agrona.concurrent.IdleStrategy;
import uk.co.real_logic.agrona.concurrent.NoOpIdleStrategy;

public final class Constants {

    private Constants() {}

    public static final int SERVER_STREAM_ID = 1;

    public static final int CLIENT_STREAM_ID = 2;

    public static final byte[] EMTPY = new byte[0];

    public static final int QUEUE_SIZE = Integer.getInteger("reactivesocket.aeron.framesSendQueueSize", 262144);

    public static final IdleStrategy SERVER_IDLE_STRATEGY = new NoOpIdleStrategy();

    public static final int CONCURRENCY = Integer.getInteger("reactivesocket.aeron.clientConcurrency", 2);

    public static final int AERON_MTU_SIZE = Integer.getInteger("aeron.mtu.length", 4096);

    public static final boolean TRACING_ENABLED = Boolean.getBoolean("reactivesocket.aeron.tracingEnabled");

}<commit_msg>added constant so you can switch your idle stratetgy and made the default the backoff strategy<commit_after>/**
 * Copyright 2015 Netflix, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.reactivesocket.aeron.internal;

import uk.co.real_logic.agrona.concurrent.BackoffIdleStrategy;
import uk.co.real_logic.agrona.concurrent.IdleStrategy;
import uk.co.real_logic.agrona.concurrent.NoOpIdleStrategy;
import uk.co.real_logic.agrona.concurrent.SleepingIdleStrategy;

import java.util.concurrent.TimeUnit;

public final class Constants {

    private Constants() {}

    public static final int SERVER_STREAM_ID = 1;

    public static final int CLIENT_STREAM_ID = 2;

    public static final byte[] EMTPY = new byte[0];

    public static final int QUEUE_SIZE = Integer.getInteger("reactivesocket.aeron.framesSendQueueSize", 262144);

    public static final IdleStrategy SERVER_IDLE_STRATEGY;

    public static final int CONCURRENCY = Integer.getInteger("reactivesocket.aeron.clientConcurrency", 2);

    public static final int AERON_MTU_SIZE = Integer.getInteger("aeron.mtu.length", 4096);

    public static final boolean TRACING_ENABLED = Boolean.getBoolean("reactivesocket.aeron.tracingEnabled");

    static {
        String idlStrategy = System.getProperty("idleStrategy");

        if (NoOpIdleStrategy.class.getName().equalsIgnoreCase(idlStrategy)) {
            SERVER_IDLE_STRATEGY = new NoOpIdleStrategy();
        } else if (SleepingIdleStrategy.class.getName().equalsIgnoreCase(idlStrategy)) {
            SERVER_IDLE_STRATEGY = new SleepingIdleStrategy(TimeUnit.MILLISECONDS.toNanos(250));
        } else {
            SERVER_IDLE_STRATEGY = new BackoffIdleStrategy(1, 10, 100, 1000);
        }
    }
}
{'fraction_non_alphanumeric': 0.08246597277822258, 'fraction_numerical': 0.01521216973578863, 'mean_word_length': 4.2863187588152325, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3527623', 'n_tokens_mistral': 1133, 'n_tokens_neox': 1052, 'n_words': 337}