Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reunite the watch-streaming-freezing coroutines #609

Merged
merged 3 commits into from Dec 13, 2020

Conversation

nolar
Copy link
Owner

@nolar nolar commented Dec 13, 2020

In ec2c152, a simple streaming coroutine has been split to monitor for freeze flags/modes on the streaming itself (before that, the stream was always on, but the events were ignored). Now, that freeze controlling logic requires much more sophistication, so it is extracted into a separate context manager, while the streaming routines are re-united back:

  • one for the infinite watch — until the operator exits or the resource becomes out of scope (the latter is not yet done);
  • one for the continuous watch: one initial listing + multiple streams — as long as the resource version is valid;
  • and one for a single watch (a single API call).

This also simplifies the tests for freezing/resuming of the streams — no mocked streams are needed anymore.

Relies on #608.

In ec2c152, a simple streaming coroutine has been split to monitor for freeze flags/modes on the streaming itself (before that, the stream was always on, but the events were ignored). Now, that freeze controlling logic requires much more sophistication, so it is extracted into a separate context manager, while the streaming routines are re-united back:

* one for the infinite watch — until the operator exits or the resource becomes out of scope (the latter is not yet done);
* one for the continuous watch: one initial listing + multiple streams — as long as the resource version is valid;
* and one for a single watch (a single API call).

This also simplifies the tests for freezing/resuming of the streams — no mocked streams are needed anymore.
@nolar nolar added the refactoring Code cleanup without new features added label Dec 13, 2020
@nolar nolar merged commit 8601875 into master Dec 13, 2020
@nolar nolar deleted the reunite-streaming-routines branch December 13, 2020 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Code cleanup without new features added
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant