Example usage for io.netty.channel.epoll EpollEventLoopGroup setIoRatio

List of usage examples for io.netty.channel.epoll EpollEventLoopGroup setIoRatio

Introduction

In this page you can find the example usage for io.netty.channel.epoll EpollEventLoopGroup setIoRatio.

Prototype

@Deprecated
public void setIoRatio(int ioRatio) 

Source Link

Usage

From source file:com.mpush.netty.client.NettyTCPClient.java

License:Apache License

private void createEpollClient(Listener listener) {
    EpollEventLoopGroup workerGroup = new EpollEventLoopGroup(getWorkThreadNum(),
            new DefaultThreadFactory(ThreadNames.T_TCP_CLIENT));
    workerGroup.setIoRatio(getIoRate());
    createClient(listener, workerGroup, EpollSocketChannel::new);
}

From source file:com.mpush.netty.server.NettyTCPServer.java

License:Apache License

private void createEpollServer(Listener listener) {
    EventLoopGroup bossGroup = getBossGroup();
    EventLoopGroup workerGroup = getWorkerGroup();

    if (bossGroup == null) {
        EpollEventLoopGroup epollEventLoopGroup = new EpollEventLoopGroup(getBossThreadNum(),
                getBossThreadFactory());
        epollEventLoopGroup.setIoRatio(100);
        bossGroup = epollEventLoopGroup;
    }/*from ww  w  .  j av  a 2  s . c o m*/

    if (workerGroup == null) {
        EpollEventLoopGroup epollEventLoopGroup = new EpollEventLoopGroup(getWorkThreadNum(),
                getWorkThreadFactory());
        epollEventLoopGroup.setIoRatio(getIoRate());
        workerGroup = epollEventLoopGroup;
    }

    createServer(listener, bossGroup, workerGroup, EpollServerSocketChannel::new);
}

From source file:com.mpush.netty.udp.NettyUDPConnector.java

License:Apache License

@SuppressWarnings("unused")
private void createEpollServer(Listener listener) {
    EpollEventLoopGroup eventLoopGroup = new EpollEventLoopGroup(1,
            new DefaultThreadFactory(ThreadNames.T_GATEWAY_WORKER));
    eventLoopGroup.setIoRatio(100);
    createServer(listener, eventLoopGroup, EpollDatagramChannel::new);
}

From source file:io.vertx.core.net.impl.transport.EpollTransport.java

License:Open Source License

@Override
public EventLoopGroup eventLoopGroup(int nThreads, ThreadFactory threadFactory, int ioRatio) {
    EpollEventLoopGroup eventLoopGroup = new EpollEventLoopGroup(nThreads, threadFactory);
    eventLoopGroup.setIoRatio(ioRatio);
    return eventLoopGroup;
}