Example: follow an endpoint's workers live with watch_workers

Aperta Adatta ai principianti
#3 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
90/100
Tipo di issue
Documentazione
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

Leggi apidly/client.py per watch_workers, poi confronta examples/05_async_and_errors.py e tests/test_endpoint_watch.py. Crea examples/07_watch_endpoint_workers.py per accettare un ID endpoint, stampare ogni modifica e terminare correttamente con Ctrl-C; aggiungilo a examples/README.md. Il lavoro è completato quando python -m py_compile e ruff check vengono eseguiti correttamente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Python
Stelle
1
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apidly-ltd/apidly-python

Tutte le issue di apidly-ltd/apidly-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.