Add finalize() and AutoCloseable support to AblyRest instances#807
Add finalize() and AutoCloseable support to AblyRest instances#807QuintinWillison merged 8 commits intomainfrom
finalize() and AutoCloseable support to AblyRest instances#807Conversation
… order to shut it down on finalize(). I've also removed the use of generics from HttpScheduler as they were there for no good reason.
ikbalkaya
left a comment
There was a problem hiding this comment.
I made a comment on a line, otherwise looks good.
|
I'm going to move this PR back to Draft state while I work out why the integration tests are failing in the REST suite. It is failing for me locally, possibly as a result of an unrelated move from Java 8 to 11 locally, but that's TBC. Sorry for the noise. |
|
We've identified that there has been a regression in the sandbox test environment. Specifically, proven using this command: Where it currently returns results, instead of exhibit expected behaviour which is to fail with:
As such, any integration test failures at the moment where they are only from the |
A dual pronged approach to resolve #801.
Either:
finalize()implementation in f29e497 will passively clean up the thread pool executor once GC catches cleans up theAsyncHttpSchedulerinstance (once it's no longer referenced by theAblyRestinstance that created it)AutoCloseablein 56593e5 will allow app developers to explicitly callclose()on theirAblyRestinstances, or use try-with-resources