Example: follow an endpoint's workers live with watch_workers

Đang mở Phù hợp với người mới
#3 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
90/100
Loại issue
Tài liệu
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python

Hướng nghiên cứu

Đọc apidly/client.py để tìm hiểu watch_workers, sau đó so sánh examples/05_async_and_errors.py và tests/test_endpoint_watch.py. Tạo examples/07_watch_endpoint_workers.py để nhận ID endpoint, in ra mỗi thay đổi và thoát gọn khi nhấn Ctrl-C; thêm tệp này vào examples/README.md. Hoàn thành khi python -m py_compile và ruff check chạy thành công.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

documentation good first issue help wanted

Context

client.endpoints.watch_workers(id) is a generator over Server-Sent Events: a snapshot first, then one item per worker change, reconnecting by itself. It is covered by tests/test_endpoint_watch.py but there is no example.

Acceptance criteria

  • examples/07_watch_endpoint_workers.py: takes an endpoint id as an argument, prints each change, exits cleanly on Ctrl-C. Read-only; standard library plus apidly only.
  • A row in examples/README.md; python -m py_compile passes and the file is clean under ruff check.

Pointers

  • apidly/client.py (watch_workers), tests/test_endpoint_watch.py, examples/05_async_and_errors.py

Not sure where to start, or want to claim it? Comment here first, or ask in Discussions. See CONTRIBUTING.md. Tests run offline and never call the real API.

Ngôn ngữ chính
Python
Star
1
Fork
0
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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của apidly-ltd/apidly-python

Tất cả issue của apidly-ltd/apidly-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.