Going Reactive - High Performance JVM code with Reactor
I gave this talk at JAX 2014. It is an introduction into reactive programming, why its needed and how the Reactor framework can help you achieve those goals.
• Lives between user and low-‐level code. • Suite for: drivers, libraries, event-‐driven systems • Part of Spring IO • 1.1.0 Released (h?ps://github.com/reactor/reactor)
Task Execu6on. ThreadPoolExecutorDispatcher execu>ng tasks in a thread pool EventLoopDispatcher mul>ple event loops dispatching tasks RingBufferDispatcher uses the LMAX Disruptor RingBuffer ActorDispatcher to pin keys to threads SynchronousDispatcher for tes>ng
public interface Consumer<T> { void accept(T t); } • Supply the caller with T. public interface Supplier<T> { T get(); } • Perform work on T and return V. public interface Function<T, V> { V apply(T t); } • Check if the input matches the criteria. public interface Predicate<T> { boolean test(T t); }
into ApplicationContext @EnableReactor Wiring annotated handlers • DispatcherTaskExecutor Not intended for “high scale” Used to get Spring components running in the same thread as Reactor consumers.
today! Buffer tooling Sequencing/EventOrdering Work Queue support on top of Java Chronicle Logback Appender Language Constructs (i.e. Tuples,…)