hazelcast / hazelcast/hazelcast-python-client

Consider separating client configuration from other options to HazelcastClient constructor

Aperta
#352 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Priority: Low Source: Internal Type: Cleanup
Lingua principale
Python
Stelle
116
Fork
78
Merge medio
10g 22h
PR unite (30g)
1

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
api, backend
Tipo di issue
Refactoring
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.