raboof commented on PR #2486:
URL: https://github.com/apache/pekko/pull/2486#issuecomment-3522830185

   > > Is there a requirement for close to block until the closing is 
'complete'?
   > 
   > I believe so otherwise you can get weird behaviour but I will do research 
to confirm. From what I gather (and also when learning Kotlin and using stuff 
like Arrow Resource), `AutoCloseable` is kind of pointless if the `close` 
method is asynchronous
   
   Why? When I want to make sure the cleanup is triggered but don't care too 
much when it happens, it might be fine?
   
   > which is why you have stuff like 
https://docs.datastax.com/en/latest-java-driver-api/com/datastax/oss/driver/api/core/AsyncAutoCloseable.html
   
   It's an interesting data point that the `close` of that one is also blocking.
    
   > > I can see the appeal, though blocking is a bit 'uncharacteristic' for 
us. I guess because you're stopping the ActorSystem and thus are anyway 'on 
your way out' it might be fine?
   > 
   > To clarify, if I replace `Await.result` with `close` its because the 
behaviour of blocking is exactly the same. In those cases, the only thing that 
would have changed would be the timeout (i.e. sometimes it was 15 seconds, 
sometimes 20 but these are all tests so it shouldn't be an issue anyways).
   
   Sure, I meant blocking in the 'production' code is a bit uncharacteristic - 
in tests it's indeed definitely fine.


-- 
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