@Bean public Reactor reactor(Environment environment) { return Reactors.reactor(environment, Environment.THREAD_POOL); }
public EventOpener() { env = new Environment(); reactor = Reactors.reactor(env, Environment.RING_BUFFER); reactor.on(SELECTOR, CONSUMER); }
public EventOpener() { env = new Environment(); reactor = Reactors.reactor(env, Environment.RING_BUFFER); reactor.on(SELECTOR, CONSUMER); }
public ZeroMQ(Environment env, Dispatcher dispatcher) { this.env = env; this.dispatcher = dispatcher; this.reactor = Reactors.reactor(env, dispatcher); this.zmqCtx = new ZContext(); this.zmqCtx.setLinger(100); }
public Reactor createReactor() { return Reactors.reactor().env(env).dispatcher(Environment.THREAD_POOL).get(); }
protected AbstractTcpConnection(Environment env, Codec<Buffer, IN, OUT> codec, Dispatcher ioDispatcher, Dispatcher eventsDispatcher) { this.env = env; this.ioDispatcher = ioDispatcher; this.ioReactor = Reactors.reactor(env, ioDispatcher); this.eventsReactor = Reactors.reactor(env, eventsDispatcher); if(null != codec) { this.decoder = codec.decoder(new NotifyConsumer<IN>(read.getT2(), eventsReactor)); this.encoder = codec.encoder(); } else { this.decoder = null; this.encoder = null; } this.replyToKeys = BlockingQueueFactory.createQueue(); consume(new Consumer<IN>() { @Override public void accept(IN in) { try { AbstractTcpConnection.this.eventsReactor.notify(replyToKeys.remove(), Event.wrap(in)); } catch(NoSuchElementException ignored) { } } }); }
Assert.notNull(env, "Environment cannot be null."); ReactorSpec spec = Reactors.reactor().env(env); if(null != dispatcher) { if("sync".equals(dispatcher)) {
Assert.notNull(env, "Environment cannot be null."); ReactorSpec spec = Reactors.reactor().env(env); if(null != dispatcher) { if("sync".equals(dispatcher)) {