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

ru.tinkoff.kora.netty.common.NettyTransportConfig Maven / Gradle / Ivy

There is a newer version: 1.1.16
Show newest version
package ru.tinkoff.kora.netty.common;

import io.netty.util.NettyRuntime;
import jakarta.annotation.Nullable;
import ru.tinkoff.kora.config.common.annotation.ConfigValueExtractor;

@ConfigValueExtractor
public interface NettyTransportConfig {

    enum EventLoop {
        NIO,
        EPOLL,
        KQUEUE
    }

    /**
     * @return Preferred Netty transport to use, if not available then first available is used by order (EPOLL / KQUEUE / NIO)
     */
    @Nullable
    EventLoop transport();

    default int threads() {
        return NettyRuntime.availableProcessors() * 2;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy