hazelcast / hazelcast/hazelcast-python-client

Make HazelcastClient context manager aware (PEP-343)

Open
#638 0 comments 0 reactions 0 assignees View on GitHub
Source: Community
Dominant language
Python
Stars
116
Forks
78
Avg merge
10d 22h
Merged PRs (30d)
1

Description

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:

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

make calls like this:
```python
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!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.