Multiple concurrent gRPC subscriptions
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Documentación
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Stack tecnológico
- grpc, python
- Área
- api, networking
Línea de trabajo
Comienza con el ejemplo get_if_rate.py y el punto de entrada GRPCClient.subscribe(query) descrito en el issue. Investiga cómo se podrían gestionar múltiples streams de dispositivos, VRF y peers sin un hilo por suscripción, incluida la limitación de asyncio indicada. Se considerará terminado cuando el enfoque escalable compatible esté aclarado en la documentación o en un ejemplo nuevo.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
I am struggling to work out how to subscribe to multiple streams of information. In my case that I am testing with at the moment, I want to subscribe to multiple bits of BGP information across multiple devices and react to changes.
Devices:
path_elements = ["DatasetInfo", "Devices"]
Then for each device it's BGP VRFS:
path_elements = ["Devices", <DeviceID>, "versioned-data", "routing", "bgp", "status", "vrf"]
Then for each device VRF, it's BGP Peers:
path_elements = ["Devices", <DeviceID>, "versioned-data", "routing", "bgp", "status", "vrf", <VRF>, "bgpPeerInfoStatusEntry"]
My script then reacts to event changes in the BGP peer states, and also adds or removed devices VRFs and peers as the updates come in. It almost works beautifully, but...
Because the grpc_client.subscribe(query) never returns, I initially ran it in a thread. This works for a few devices, VRFs and Peers, but is not very scalable. Once I got to 129 threads, I could not run any more. I tried using asyncio, but it appears while grpcio is supposed to support asyncio the cloudvision module does not. The examples as far as I can see only have very simplistic subscribe models. For example, the get_if_rate.py only gets a single metric from a single interface.
with GRPCClient(apiserverAddr, token=token, certs=cert, key=key,
ca=ca) as client:
for batch in client.subscribe(query):
for notif in batch["notifications"]:
pretty_print(notif["updates"])
I can't see a good way to deal with subscriptions in a scalable way using the cloudvision module. can someone please clarify how this should be done. It would be good if this can also be reflected in the Docs or examples. If it is already in there, and I am blind or stupid, can someone please point me in the right direction.
- Lenguaje dominante
- Python
- Estrellas
- 37
- Forks
- 26
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de aristanetworks/cloudvision-python
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
aristanetworks/cloudvision-python#12 · 2 comentarios ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
aristanetworks/cloudvision-python#3 · 1 comentario ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
aristanetworks/cloudvision-python#1 · 1 comentario ·
Todos los issues de aristanetworks/cloudvision-python
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
modelcontextprotocol/python-sdk#3648 ·
Los mantenedores suelen responder en 1 día
-
docs good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
VenetoStato/giorgio#6 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
Claiming namespace ddalusAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 70/100
EclipseFdn/open-vsx.org#13831 ·
Los mantenedores suelen responder en 1 día