chibenwa commented on PR #2486:
URL: https://github.com/apache/james-project/pull/2486#issuecomment-2457737941

   ```
       private Sinks.Many<Integer> objectMany;
       private CountDownLatch countDownLatch;
   
       @Test
       void test() throws Exception {
           countDownLatch = new CountDownLatch(1);
           objectMany = Sinks.many().multicast().onBackpressureBuffer();
           objectMany.asFlux()
               .subscribeOn(Schedulers.parallel())
               .subscribe(i -> Mono.delay(Duration.ofMillis(1))
                   .doFinally(any -> betise(i))
                   .subscribe());
           objectMany.emitNext(1, Sinks.EmitFailureHandler.FAIL_FAST);
           countDownLatch.await();
       }
   
       void betise(int i) {
           if (i < 20000) {
               System.out.println(i);
               objectMany.emitNext(i + 1, Sinks.EmitFailureHandler.FAIL_FAST);
           } else {
               countDownLatch.countDown();
           }
       }
   ```
   
   Using signaling technics apparently do avoid the effect mentioned in 
https://github.com/apache/james-project/pull/2486#issuecomment-2457568663


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org
For additional commands, e-mail: notifications-h...@james.apache.org

Reply via email to