Skip to content

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

@lospejos

Description

@lospejos

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!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions