Package reactor.core

Examples of reactor.core.Reactor$ReplyToEvent


  private Reactor createReactor(Dispatcher dispatcher) {
    if (traceEventPath) {
      dispatcher = new TraceableDelegatingDispatcher(dispatcher);
    }
    return new Reactor((consumerRegistry != null ? consumerRegistry : createRegistry()),
                       dispatcher,
                       (router != null ? router : createEventRouter()),
                       dispatchErrorHandler,
                       uncaughtErrorHandler);
  }
View Full Code Here


    assertThat("Last is 5", last.tap().get(), is(5));
  }

  @Test
  public void testRelaysEventsToReactor() throws InterruptedException {
    Reactor r = Reactors.reactor().get();
    Selector key = Selectors.$();

    final CountDownLatch latch = new CountDownLatch(5);
    final Tap<Event<Integer>> tap = new Tap<Event<Integer>>() {
      @Override
      public void accept(Event<Integer> integerEvent) {
        super.accept(integerEvent);
        latch.countDown();
      }
    };

    r.on(key, tap);

    Stream<String> stream = Streams.just("1", "2", "3", "4", "5");
    Stream<Void> s =
        stream
            .map(STRING_2_INTEGER)
View Full Code Here

                               @Nonnull Dispatcher ioDispatcher,
                               @Nonnull Reactor eventsReactor) {
    Assert.notNull(env, "IO Dispatcher cannot be null");
    Assert.notNull(env, "Events Reactor cannot be null");
    this.env = env;
    this.ioReactor = new Reactor(ioDispatcher,
                                 null,
                                 eventsReactor.getDispatchErrorHandler(),
                                 eventsReactor.getUncaughtErrorHandler());
    this.eventsReactor = new Reactor(eventsReactor.getDispatcher(),
                                     null,
                                     eventsReactor.getDispatchErrorHandler(),
                                     eventsReactor.getUncaughtErrorHandler());
    this.eventsReactor.getConsumerRegistry().clear();
    for (Registration<? extends Consumer<?>> reg : eventsReactor.getConsumerRegistry()) {
View Full Code Here

TOP

Related Classes of reactor.core.Reactor$ReplyToEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.