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

Make HazelcastClient context manager aware (PEP-343) #638

Open
lospejos opened this issue Jul 7, 2023 · 0 comments
Open

Make HazelcastClient context manager aware (PEP-343) #638

lospejos opened this issue Jul 7, 2023 · 0 comments

Comments

@lospejos
Copy link

lospejos commented Jul 7, 2023

Sorry, if the issue like this was opened before, I've searched but not found it.

Is it possible to make a HazelcastClient conext manager aware, see https://peps.python.org/pep-0343/

In short:

To be able instead of:

client = hazelcast.HazelcastClient(...)
# operations
client.shutdown()

make calls like this:

with hazelcast.HazelcastClient(...) as client:
    # operatoins...
    # no need to call client.shutdown() - it will be called by context manager

May be there are some other classes that could be also made context manager aware.

Thanks!

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