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

Improve (and shorten) query polling implementation. #4243

Merged
merged 1 commit into from
Dec 18, 2018

Commits on Dec 17, 2018

  1. Improve (and shorten) query polling implementation.

    This implementation has the following benefits:
    
    - It collapses the QueryScheduler abstraction into the QueryManager (which
      was always ultimately responsible for managing the lifetime of polling
      timers), thus simplifying the relationship between the QueryManager and
      its ObservableQuery objects.
    
    - It's about 100 bytes smaller than the previous implementation, after
      minification and gzip.
    
    - It uses setTimeout rather than setInterval, so event loop starvation
      never leads to a rapid succession of setInterval catch-up calls.
    
    - It guarantees at most one timeout will be pending for an arbitrary
      number of polling queries, rather than a separate timer for every
      distinct polling interval.
    
    - Fewer independent timers means better batching behavior, usually.
    
    - Though there may be a delay between the desired polling time for a given
      query and the actual polling time, the delay is never greater than the
      minimum polling interval across all queries, which changes dynamically
      as polling queries are started and stopped.
    benjamn committed Dec 17, 2018
    Configuration menu
    Copy the full SHA
    493f74c View commit details
    Browse the repository at this point in the history