injae-kim commented on issue #1044:
URL: 
https://github.com/apache/incubator-pekko/issues/1044#issuecomment-1911752848

   > https://github.com/reactor/reactor-core/pull/3704 Add AutoCloseable 
shourtcut on Flux#using, Mono#using
   
   ```java
        public static <T, D extends AutoCloseable> Flux<T> using(Callable<D> 
resourceSupplier,
                        Function<? super D, ? extends Publisher<? extends T>> 
sourceSupplier) {
                return using(resourceSupplier, sourceSupplier, AUTO_CLOSE, 
true);
        }
   
        static final Consumer<? super AutoCloseable> AUTO_CLOSE = resource -> {
                try {
                        resource.close(); //👈 simply close the autocloseable
                } catch (Exception e) {
                        throw new RuntimeException(e);
                }
        };
   ```
    Hi @mdedetrich ! On above PR on reactor, I use `<D extends AutoCloseable>` 
to support only `AutoCloseable` shortcut.
   and simply close it cause we usually think that it's okay to close 
`AutoCloseable`.
   
   WDYT? you mean we should handle or provide a way to user when 
`autoCloseable.close()` throw exception?


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to