Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why isn't ossClient implemented with the AutoCloseable interface? #516

Open
dyingChinese opened this issue Mar 18, 2024 · 0 comments
Open

Comments

@dyingChinese
Copy link

I would like to understand the reason behind the decision to not implement the ossClient class with the AutoCloseable interface. The AutoCloseable interface provides a convenient way to automatically release resources when they are no longer needed, by utilizing the try-with-resources statement.

By implementing the AutoCloseable interface, the ossClient class could be used within a try-with-resources block, ensuring that any underlying resources are properly released, such as network connections or file handles. This can help prevent resource leaks and improve the overall reliability and performance of the application.

I'm curious to know the rationale behind not including this interface in the ossClient class and whether there are any alternative approaches or best practices recommended for handling resource cleanup when working with the ossClient in a production environment.

Thank you for your insights and clarification on this matter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant