Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Add async completion handler to MGLOfflineStorage::preloadData #188

Merged
merged 3 commits into from
Mar 16, 2020

Conversation

alexshalamov
Copy link
Contributor

As the database operations were moved to separate thread to avoid blocking resource loading, it might be required to know when preloadData has been completed.

@alexshalamov alexshalamov marked this pull request as ready for review March 1, 2020 09:28
@alexshalamov alexshalamov requested a review from a team March 1, 2020 09:28
@alexshalamov
Copy link
Contributor Author

alexshalamov commented Mar 1, 2020

@julianrex @1ec5 do you think completion handler needs to be exposed publicly or we can have it as an internal method?

Copy link
Contributor

@1ec5 1ec5 left a comment

Choose a reason for hiding this comment

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

Suggested changelog entry (iOS and macOS):

  • Added the -[MGLOfflineStorage preloadData:forURL:modificationDate:expirationDate:eTag:mustRevalidate:completionHandler:] method for determining when the data is ready to retrieve from the cache. (#188)

platform/darwin/src/MGLOfflineStorage.h Outdated Show resolved Hide resolved
platform/darwin/src/MGLOfflineStorage.h Outdated Show resolved Hide resolved
platform/darwin/src/MGLOfflineStorage.h Show resolved Hide resolved
platform/darwin/src/MGLOfflineStorage.h Outdated Show resolved Hide resolved
platform/darwin/src/MGLOfflineStorage.mm Outdated Show resolved Hide resolved
@1ec5
Copy link
Contributor

1ec5 commented Mar 2, 2020

do you think completion handler needs to be exposed publicly or we can have it as an internal method?

In general, the public API should accept a completion handler or delegate or send a notification for any asynchronous operation if possible.

@1ec5 1ec5 added this to the release-vanillashake milestone Mar 2, 2020
@alexshalamov alexshalamov force-pushed the alexshalamov_async_preloadData branch 2 times, most recently from 603e78a to e12b7c1 Compare March 4, 2020 16:36
platform/darwin/src/MGLOfflineStorage.h Outdated Show resolved Hide resolved
@1ec5
Copy link
Contributor

1ec5 commented Mar 10, 2020

Also a question about deprecation: #188 (comment).

@alexshalamov alexshalamov force-pushed the alexshalamov_async_preloadData branch from e12b7c1 to 44fdcfe Compare March 11, 2020 18:17
@alexshalamov
Copy link
Contributor Author

alexshalamov commented Mar 11, 2020

@1ec5 @julianrex moved completion handler definition. Please feel free to merge if needed.

@alexshalamov alexshalamov merged commit 8b12c6b into master Mar 16, 2020
@alexshalamov alexshalamov deleted the alexshalamov_async_preloadData branch March 16, 2020 08:20
alexshalamov added a commit that referenced this pull request Mar 26, 2020
Fixes pause/resume bug introduced in #188
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants