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