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

refactor(pollingset): make bad state impossible #6396

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Hweinstock
Copy link
Contributor

Problem

Right now PollingSet exposes both the add and the start methods. The start adds the item and starts the timer, while the add only adds the item.

This allows a consumer to create a non-empty PollingSet where the timer never started.

Solution

  • Overwrite the add method so that a consumer is forced to start the timer when adding items.

  • Treat all work as PUBLIC. Private feature/x branches will not be squash-merged at release time.
  • Your code changes must meet the guidelines in CONTRIBUTING.md.
  • License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@Hweinstock Hweinstock marked this pull request as ready for review January 17, 2025 19:39
@Hweinstock Hweinstock requested a review from a team as a code owner January 17, 2025 19:39
Copy link
Contributor

@justinmk3 justinmk3 left a comment

Choose a reason for hiding this comment

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

Nice!

@justinmk3
Copy link
Contributor

Overwrite the add method so that a consumer is forced to start the timer when adding items.

it's only overriding, right? "overwrite" makes me think of this.add = () => { ... } :)

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.

2 participants