Multiple concurrent gRPC subscriptions
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- grpc, python
- Lĩnh vực
- api, networking
Hướng nghiên cứu
Bắt đầu với ví dụ get_if_rate.py và điểm vào GRPCClient.subscribe(query) được mô tả trong issue. Điều tra cách xử lý nhiều stream của thiết bị, VRF và peer mà không cần một thread cho mỗi subscription, bao gồm cả hạn chế asyncio đã được báo cáo. Được xem là hoàn thành khi phương pháp có khả năng mở rộng được hỗ trợ đã được làm rõ trong tài liệu hoặc trong một ví dụ mới.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 37
- Fork
- 26
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của aristanetworks/cloudvision-python
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
aristanetworks/cloudvision-python#12 · 2 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
aristanetworks/cloudvision-python#3 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
aristanetworks/cloudvision-python#1 · 1 bình luận ·
Tất cả issue của aristanetworks/cloudvision-python
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Juniper/ansible-junos-stdlib#904 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
pollen-robotics/reachy_mini#1457 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:runtime good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
WATonomous/wato_f1tenth#39 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
FireDynamics/fdsreader#123 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100