public static Consumer<Subscription> subscriberLoop(final FragmentHandler fragmentHandler, final int limit,
                    final AtomicBoolean running, final IdleStrategy idleStrategy, final AtomicBoolean launched) {
        return (subscription) -> {
            try {
                while (running.get()) {
                    idleStrategy.idle(subscription.poll(fragmentHandler, limit));
                    launched.set(true);
                }
            } catch (final Exception ex) {
                LangUtil.rethrowUnchecked(ex);
            }
        };
    }
public static Consumer < Subscription > subscriberLoop ( final FragmentHandler fragmentHandler , final int limit , final AtomicBoolean running , final IdleStrategy idleStrategy , final AtomicBoolean launched ) { return ( subscription ) -> { try { while ( running . get ( ) ) { idleStrategy . idle ( subscription . poll ( fragmentHandler , limit ) ) ; launched . set ( true ) ; } } catch ( final Exception ex ) { LangUtil . rethrowUnchecked ( ex ) ; } } ; }
Return a reusable, parameterized event
loop that calls and idler
when no messages are received

@param fragmentHandler to be called back for each message.
@param limit           passed to {@link Subscription#poll(FragmentHandler, int)}
@param running         indication for loop
@param idleStrategy    to use for loop
@return loop function