hazelcast / hazelcast/hazelcast-python-client
Consider separating client configuration from other options to HazelcastClient constructor
- Lenguaje dominante
- Python
- Estrellas
- 116
- Forks
- 78
- Merge medio
- 10 d 22 h
- PR fusionados (30 d)
- 1
Descripción
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
Guía de contribución
Línea de trabajo
Comienza revisando el constructor de HazelcastClient y la configuración actual de palabras clave sin nombre que se muestra en el issue. Lee los issues enlazados 351 y 353 para comprender la configuración declarativa y las restricciones de separación de conexiones; el trabajo estará terminado cuando las opciones del cliente y la configuración del clúster tengan interfaces distintas y el uso de ejemplo refleje esa separación.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- api, backend
- Tipo de issue
- Refactorización
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 25/100