Multiple concurrent gRPC subscriptions
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 25/100
- Type d'issue
- Documentation
- Clarté
- À clarifier
- Activité
- À l'abandon
- Stack technique
- grpc, python
- Domaine
- api, networking
Piste de recherche
Commencez par l’exemple get_if_rate.py et le point d’entrée GRPCClient.subscribe(query) décrit dans l’issue. Étudiez comment plusieurs flux de périphériques, de VRF et de pairs pourraient être gérés sans un thread par abonnement, y compris la limitation asyncio signalée. La tâche sera considérée comme terminée lorsque l’approche évolutive prise en charge sera clarifiée dans la documentation ou dans un nouvel exemple.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Python
- Étoiles
- 38
- Forks
- 26
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
- Fournit un Dockerfile ou un fichier Docker Compose
- Aucun modèle de pull request
- Aucun guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de aristanetworks/cloudvision-python
-
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
-
Difficulté 4/5 3-5 jours Accessibilité débutants 30/100
aristanetworks/cloudvision-python#12 · 2 commentaires ·
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
-
Difficulté 4/5 3-5 jours Accessibilité débutants 25/100
aristanetworks/cloudvision-python#3 · 1 commentaire ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 45/100
aristanetworks/cloudvision-python#1 · 1 commentaire ·
Toutes les issues de aristanetworks/cloudvision-python
Issues similaires
-
integration: logger
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
home-assistant/core#191147 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
Les mainteneurs répondent en général sous 1 jour
-
documentation p4
Difficulté 1/5 1-3 heures Accessibilité débutants 88/100
MillenniumDawn/focus-tree-creation-tool#417 ·
Les mainteneurs répondent en général sous 3 jours
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
CharlesP44/Beem_Energy#96 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
rheeloaded/paperpull#153 ·
Les mainteneurs répondent en général sous 1 jour