public ZeroMQTcpServer(@Nonnull Environment env, @Nonnull Reactor reactor, @Nullable InetSocketAddress listenAddress, ServerSocketOptions options, SslOptions sslOptions, @Nullable Codec<Buffer, IN, OUT> codec, @Nonnull Collection<Consumer<NetChannel<IN, OUT>>> consumers) { super(env, reactor, listenAddress, options, sslOptions, codec, consumers); this.ioThreadCount = env.getProperty("reactor.zmq.ioThreadCount", Integer.class, 1); if (options instanceof ZeroMQServerSocketOptions) { this.zmqOpts = (ZeroMQServerSocketOptions) options; } else { this.zmqOpts = null; } this.threadPool = Executors.newCachedThreadPool(new NamedDaemonThreadFactory("zmq-server")); }
this.resolution = resolution; this.loop = new NamedDaemonThreadFactory("hash-wheel-timer").newThread( new Runnable() { @Override
/** * Create a new {@literal ThreadPoolExecutorDispatcher} with the given size, backlog, name, and {@link * java.util.concurrent.RejectedExecutionHandler}. * * @param poolSize * the pool size * @param backlog * the backlog size * @param threadName * the name prefix to use when creating threads * @param rejectedExecutionHandler * the {@code RejectedExecutionHandler} to use when jobs can't be submitted to the thread pool */ public ThreadPoolExecutorDispatcher(int poolSize, int backlog, String threadName, BlockingQueue<Runnable> workQueue, RejectedExecutionHandler rejectedExecutionHandler) { super(poolSize, backlog); this.executor = new ThreadPoolExecutor( poolSize, poolSize, 0L, TimeUnit.MILLISECONDS, workQueue, new NamedDaemonThreadFactory(threadName, getContext()), rejectedExecutionHandler ); }
this.loop = new NamedDaemonThreadFactory(name).newThread(new Runnable() { @Override public void run() {
public ZeroMQTcpClient(@Nonnull Environment env, @Nonnull Reactor reactor, @Nonnull InetSocketAddress connectAddress, @Nullable ClientSocketOptions options, @Nullable SslOptions sslOptions, @Nullable Codec<Buffer, IN, OUT> codec, @Nonnull Collection<Consumer<NetChannel<IN, OUT>>> consumers) { super(env, reactor, connectAddress, options, sslOptions, codec, consumers); this.ioThreadCount = env.getProperty("reactor.zmq.ioThreadCount", Integer.class, 1); if (options instanceof ZeroMQClientSocketOptions) { this.zmqOpts = (ZeroMQClientSocketOptions) options; } else { this.zmqOpts = null; } this.threadPool = Executors.newCachedThreadPool(new NamedDaemonThreadFactory("zmq-client")); }
TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(), new NamedDaemonThreadFactory("ringBufferAppEventPublisher") );
Environment.PROCESSORS / 2); int ioThreadCount = env.getProperty("reactor.tcp.ioThreadCount", Integer.class, Environment.PROCESSORS); this.selectorGroup = new NioEventLoopGroup(selectThreadCount, new NamedDaemonThreadFactory("reactor-tcp-select")); if (null != nettyOptions && null != nettyOptions.eventLoopGroup()) { this.ioGroup = nettyOptions.eventLoopGroup(); } else { this.ioGroup = new NioEventLoopGroup(ioThreadCount, new NamedDaemonThreadFactory("reactor-tcp-io"));
Environment.PROCESSORS / 2); int ioThreadCount = env.getProperty("reactor.tcp.ioThreadCount", Integer.class, Environment.PROCESSORS); selectorGroup = new NioEventLoopGroup(selectThreadCount, new NamedDaemonThreadFactory("reactor-tcp-select")); ioGroup = new NioEventLoopGroup(ioThreadCount, new NamedDaemonThreadFactory("reactor-tcp-io"));
ioGroup = new NioEventLoopGroup(ioThreadCount, new NamedDaemonThreadFactory("reactor-tcp-io"));
Integer.class, Environment.PROCESSORS); this.ioGroup = new NioEventLoopGroup(ioThreadCount, new NamedDaemonThreadFactory("reactor-udp-io"));
} else { int ioThreadCount = env.getProperty("reactor.tcp.ioThreadCount", Integer.class, Environment.PROCESSORS); this.ioGroup = new NioEventLoopGroup(ioThreadCount, new NamedDaemonThreadFactory("reactor-tcp-io"));
Assert.notNull(errorConsumers, "Error Consumers Registry cannot be null."); executor = Executors.newCachedThreadPool(new NamedDaemonThreadFactory("processor"));
ExecutorService executor) { if(null == executor) { this.executor = Executors.newFixedThreadPool(eventThreads, new NamedDaemonThreadFactory(name)); this.shutdownExecutor = true; } else {
WaitStrategy waitStrategy) { super(bufferSize); this.executor = Executors.newSingleThreadExecutor(new NamedDaemonThreadFactory(name, getContext())); this.disruptor = new Disruptor<RingBufferTask>( new EventFactory<RingBufferTask>() {
this.executor = Executors.newFixedThreadPool( poolSize, new NamedDaemonThreadFactory(name, getContext()) ); this.disruptor = new Disruptor<WorkQueueTask>(