hazelcast / hazelcast/hazelcast-python-client

Consider separating client configuration from other options to HazelcastClient constructor

Offen
#352 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Priority: Low Source: Internal Type: Cleanup
Vorherrschende Sprache
Python
Sterne
116
Forks
78
Ø Merge
10 T. 22 Std.
Gemergte PRs (30 T.)
1

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start by reviewing the HazelcastClient constructor and the current unnamed-keyword configuration shown in the issue. Read linked issues 351 and 353 to understand the declarative configuration and connection-separation constraints; the work is done when client options and cluster configuration have distinct interfaces and the example usage reflects that separation.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
api, backend
Issue-Typ
Refactoring
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.