hazelcast / hazelcast/hazelcast-python-client

Consider separating client configuration from other options to HazelcastClient constructor

Open
#352 2 comments 0 reactions 0 assignees View on GitHub
Priority: Low Source: Internal Type: Cleanup
Dominant language
Python
Stars
116
Forks
78
Avg merge
10d 22h
Merged PRs (30d)
1

Description

Currently both client configuration and other options, such as lifecycle listeners are passed as unnamedkeyword arguments to `HazelcastClient` constructor. This works well ATM, but it may be problematic when we decide to add support for declarative configuration https://github.com/hazelcast/hazelcast-python-client/issues/351

Currently following snippet works:
```python
config = {
"lifecycle_listeners": [],
"cluster_name": "sample-cluster"
}
hz = HazelcastClient(**config)
```

One possible way of resolving this issue is passing non-client configuration-related arguments only as named keyword arguments to `HazelcastClient` constructor and passing cluster configuration in `**kwargs` (as currently implemented).

Example:
```python
client_config = {"cluster_name": "sample-cluster"}
hz = HazelcastClient(lifecycle_listeners=[], **cluster_config)
```

Separating HazelcastClient creation and cluster connection may help with removing options like `lifecyle_listeners`. See: https://github.com/hazelcast/hazelcast-python-client/issues/353

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.