[client] Make TaskChannel usable as a generator

For a class to be usable as a python generator, it must have:
- __iter__()
- next()

I added __iter__() and renamed pull() to next().

This will be useful as a multithreaded python generator.

Splitting as a separate CL to make it easier to review.

Includes relevant unit test.

Bug: 825418
Change-Id: Ic2e8a288a991dc214dea59e9533010679d0fde21
Reviewed-on: https://chromium-review.googlesource.com/c/1349377
Commit-Queue: Marc-Antoine Ruel <maruel@chromium.org>
Reviewed-by: Quinten Yearsley <qyearsley@chromium.org>
Cr-Mirrored-From: https://chromium.googlesource.com/infra/luci/luci-py
Cr-Mirrored-Commit: df4bf3d52e3911f5415bf9613735b4811ef94fff
5 files changed
tree: 7b712ad78472975d27c4f48f3a1939e7d5a08b4b
  1. example/
  2. libs/
  3. proto/
  4. tests/
  5. third_party/
  6. tools/
  7. utils/
  8. .gitignore
  9. auth.py
  10. cipd.py
  11. isolate.py
  12. isolate_format.py
  13. isolate_storage.py
  14. isolated_format.py
  15. isolateserver.py
  16. LICENSE
  17. local_caching.py
  18. LUCI_CONTEXT.md
  19. OWNERS
  20. PRESUBMIT.py
  21. README.md
  22. README.py
  23. run_isolated.py
  24. swarming.py
  25. trace_inputs.py
  26. WATCHLISTS
README.md

LUCI Python Client

This is the Python Client code for LUCI. It's part of the main python repo, and is also mirrored into a standalone client-py repo.

To contribute changes you need to clone the main python repo and then use git cl upload. The client-py repo mirror (which appears in Chromium's third_party directory) cannot be contributed to directly.

License

This project is licensed under Apache v2.0 license. See LICENSE for details.