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

Expose Processor State With StateReader Interface #354

Merged
merged 2 commits into from
Oct 19, 2021

Conversation

jomaresch
Copy link
Contributor

Closes #343

  • add a StateReader to the processor to expose the current state.
  • PartitionTable.WaitRecovered() now returns a read only channel.

- `PartitionTable.WaitRecovered()` now returns a read only channel.
// StateReader is a read only abstraction of a Signal to expose the current state.
type StateReader interface {
State() State
WaitForState(state State) <-chan struct{}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the other functions? I know they're mostly duplication, but it's convenient :). And if we have them anyway, why not expose them in the reader interface?
I mean IsState and WaitForStateMin and ObserveStateChange

Copy link

@ubunatic ubunatic Oct 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea + maybe we can change the places where we read/wait/watch state (if any) to use the reader and not access the state directly (in another PR, if you think this makes sense)

ubunatic
ubunatic previously approved these changes Oct 4, 2021
Copy link

@ubunatic ubunatic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@frairon frairon merged commit bd9f3c7 into master Oct 19, 2021
@frairon frairon deleted the proc_add_state_reader_interface branch October 28, 2021 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Propose: expose processor state
3 participants