Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Add pause/resume API to DefaultFileSource #5236

Closed

Description

@boundsj

Currently, instances of DefaultFileSource allow revalidation requests regardless of if the host process is running in the background and the map that would benefit from the requests is visible. Mobile applications that are extremely concerned about limiting network requests that is not strictly necessary may see battery performance gains if the revalidation requests were not made in the background.

In general, this behavior probably makes sense as the default on both iOS and Android. In addition, as usage of the SDK grows, the backend will benefit from not having to respond to as many requests as it does today.

We should consider adding and exposing an API to DefaultFileSource (or similar approach) so that each platform can inform it if it makes sense to carryout network requests based on background state (or other factors).

cc @jfirebaugh @1ec5 @mick

Activity

  1. added
    performance
    on Jun 4, 2016
  2. 1ec5 commented on Jun 4, 2016

    @1ec5
    Contributor

    In the iOS SDK, we have a natural mechanism to make use of a request-pausing API, in -[MGLMapView sleepGL:] (which happens when the application recedes to the background or enters background mode) or a similar method that would be added to MGLOfflineStorage.

    We could also more aggressively pause at the point where we stop a map view's CADisplayLink (which would also happen when the map view is removed from the view hierarchy or hidden). However, the catch is that the application could have multiple views, so we'd need to refcount somehow to avoid interfering with still-visible views.

  3. tmpsantos commented on Jun 6, 2016

    @tmpsantos
    Contributor

    This could maybe implemented more generically at our class abstraction like util::Thread::pause().

  4. added this to the ios-v3.5.0 milestone on Mar 1, 2017
  5. self-assigned this
    on Mar 1, 2017
  6. boundsj commented on Mar 1, 2017

    @boundsj
    ContributorAuthor

    This was fixed by #8125 and #8194

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

performance

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions