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

Clean coreutils package, add rate limiting utilities. #6345

Merged
merged 56 commits into from May 23, 2019

Conversation

@afshin
Copy link
Member

@afshin afshin commented May 13, 2019

References

Fixes #6346

For a visual explanation of the distinction between throttling and debouncing cf.
http://demo.nimius.net/debounce_throttle/

For a more detailed explanation cf.
https://blog.bitsrc.io/understanding-throttling-and-debouncing-973131c1ba07

Code changes

  • Remove window use in state database and activity monitor.
  • Store state database contents in memory instead of in local storage using new class StateDB.Connector implements IDataConnector<string>.
  • Creates an IRateLimiter interface to describe a rate-limited function, implemented by a RateLimiter abstract class that composes a Poll instance to wrap the user function.
  • Creates concrete rate limiter implementations Debouncer and Throttler for those two rate limiting strategies. Allows for clients to implement other rate limiters if they want.
  • These classses should allow us to refactor the places where we create ad hoc debouncers. These are the places in our logic that are refactored in this PR:
    • The workspace saving logic is refactored to use a Debouncer.
    • The splash screen recovery logic is refactored to use a Throttler.
    • The document search debouncing logic now uses a Debouncer. (cc: @aschlaep)
    • The LabShell class now uses a debouncer to emit layout modified signals.

User-facing changes

N/A

Backwards-incompatible changes

  • Removes #maxLength and #namespace from IStateDB and StateDB.
  • Removes windowName from StateDB.IOptions
  • Should we move SettingRegistry somewhere else? Candidates include:
    • @jupyterlab/application
    • @jupyterlab/apputils
    • @jupyterlab/settingregistry (does not exist)
@jupyterlab-dev-mode
Copy link

@jupyterlab-dev-mode jupyterlab-dev-mode bot commented May 13, 2019

Thanks for making a pull request to JupyterLab!

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

@afshin afshin self-assigned this May 13, 2019
@afshin afshin added this to the 1.0 milestone May 13, 2019
@afshin afshin force-pushed the clean-coreutils branch from 9971ec3 to 7883e35 May 15, 2019
@afshin afshin changed the title [WIP] Clean coreutils package. Clean coreutils package. May 17, 2019
@afshin afshin force-pushed the clean-coreutils branch from d44f147 to bd2ca93 May 22, 2019
@afshin afshin changed the title [WIP] Clean coreutils package, add debounce utility. Clean coreutils package, add rate limiting utilities. May 22, 2019
@afshin afshin changed the title Clean coreutils package, add rate limiting utilities. [WIP] Clean coreutils package, add rate limiting utilities. May 22, 2019
@afshin afshin force-pushed the clean-coreutils branch from 83fa631 to e74bba8 May 22, 2019
@afshin afshin changed the title [WIP] Clean coreutils package, add rate limiting utilities. Clean coreutils package, add rate limiting utilities. May 22, 2019
@aschlaep
Copy link
Member

@aschlaep aschlaep commented May 22, 2019

Awesome, love the debouncer!

@blink1073
Copy link
Member

@blink1073 blink1073 commented May 23, 2019

Nicely done!

@blink1073 blink1073 merged commit 2834c11 into jupyterlab:master May 23, 2019
9 checks passed
@lock
Copy link

@lock lock bot commented Aug 6, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related discussion.

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