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

Update Poll#schedule() semantics. #6186

Merged
merged 4 commits into from Apr 12, 2019
Merged

Conversation

@afshin
Copy link
Member

@afshin afshin commented Apr 11, 2019

This PR implements some ideas that came out of conversations with @jasongrout during initial implementation:

  • Updates Poll#schedule() to accept Partial next state data and automatically defaults the state to known defaults:
    {
      interval: this.frequency.interval,
      payload: null,
      phase: 'standby',
      timestamp: new Date().getTime(),
    }
  • Removes Poll#ready in favor of automatically handling ready status.
  • Allows passing a cancel function along with next state data to cancel the phase transition if it is unnecessary. This is useful for e.g., conflating phases or ignoring unnecessary transitions.
  • Updates Poll#schedule() to be asynchronous.
@afshin afshin added this to the 1.0 milestone Apr 11, 2019
@jupyterlab-dev-mode
Copy link

@jupyterlab-dev-mode jupyterlab-dev-mode bot commented Apr 11, 2019

Thanks for making a pull request to JupyterLab!

To try out this branch on binder, follow this link: Binder

@afshin afshin changed the title Update Poll#schedule() semantics. [WIP] Update Poll#schedule() semantics. Apr 11, 2019
@afshin afshin changed the title [WIP] Update Poll#schedule() semantics. Update Poll#schedule() semantics. Apr 11, 2019
@ian-r-rose
Copy link
Member

@ian-r-rose ian-r-rose commented Apr 11, 2019

This may need a re-prettier

@jasongrout jasongrout merged commit d786a4a into jupyterlab:master Apr 12, 2019
9 checks passed
@jasongrout
Copy link
Contributor

@jasongrout jasongrout commented Apr 12, 2019

Great, thanks!

@lock lock bot locked as resolved and limited conversation to collaborators Aug 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants