Example: follow an endpoint's workers live with watch_workers

Open Beginner friendly
#3 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
90/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
python

Research direction

Read apidly/client.py for watch_workers, then compare examples/05_async_and_errors.py and tests/test_endpoint_watch.py. Create examples/07_watch_endpoint_workers.py to accept an endpoint ID, print each change, and exit cleanly on Ctrl-C; add it to examples/README.md. Done when python -m py_compile and ruff check pass.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Python
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apidly-ltd/apidly-python

All issues in apidly-ltd/apidly-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.