View on GitHub

swisspush

Community Contributions by Developers in the Swiss Postal IT

07 December 2017 - Laurent Bovet

You want to use Reactor (or RxJava) within a modular, readable and safe abstraction.

Reactive Plumber let you write your reactive stream plumbing in a Groovy DSL and also visualize it graphically.

It is intended to be used in Java or Groovy applications.

def data = pipe {
    from input map wrap
}

def printer = {
    from it doOnNext print
}

def renderer = pipe {
    parallel from(data) \
    map renderThread
}

def count = pipe {
    from data count()
}

def size = pipe {
    from data \
    zipWith value(count), attach \
    map renderSize \
    compose printer
}

def thread = pipe {
    from renderer compose printer
}

drain size, thread

Built using these outstanding projects:


blog comments powered by Disqus