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

[iOS] Generate and send a turnstile event when map view event is queued #3713

Merged
merged 1 commit into from
Feb 15, 2016

Conversation

boundsj
Copy link
Contributor

@boundsj boundsj commented Jan 27, 2016

This change adds logic to push a turnstile event whenever a map view
event is queued. It guards against sending the turnstile event more
than once per session.

Note that pushTurnstileEvent is actually a "force push" in that it
flushes the queue and, since it enqueues a turnstile event, the
flush's call to postEvents will attempt to send any queued events
even if telemetry is paused. This has the side effect of defeating
the other queue / timing / flush logic in place whenever map load
(and now implicitly turnstile) events are pushed.

This change does take care to continue to ensure that, in pushEvent even if the
events instance is paused, the turnstile event is still pushed.

This change drops the use of the priority background queue that used
to be used to dispatch async pushTurnstileEvent. I could not see how the
priority queue was required for that. The subsequently called implementations of
pushTurnstileEvent and flush still use the custom serial queue
and the postEvents method dispatches using a priority background
queue.

cc @1ec5 @friedbunny

@boundsj boundsj added the iOS Mapbox Maps SDK for iOS label Jan 27, 2016
@boundsj boundsj force-pushed the boundsj-send-turnstyle-on-map-load branch from 3f44d36 to 2d408d9 Compare January 27, 2016 23:42
@friedbunny friedbunny added this to the ios-v3.2.0 milestone Jan 28, 2016
- (void) pushTurnstileEvent {

__weak MGLMapboxEvents *weakSelf = self;
// Turnstile events only need to be sent up once per application launch
if (turnstileEventSent) { return; }
Copy link
Contributor

Choose a reason for hiding this comment

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

We should make a call on if () return style in MGLMapboxEvents and harmonize the entire thing.

@friedbunny
Copy link
Contributor

🚧:+1:

@1ec5
Copy link
Contributor

1ec5 commented Jan 28, 2016

👍

@boundsj boundsj force-pushed the boundsj-send-turnstyle-on-map-load branch 2 times, most recently from 99a0766 to 07755b6 Compare January 28, 2016 20:34
This change adds logic to push a turnstile event whenever a map view
event is queued. It guards against sending the turnstile event more
than once per session.

Note that `pushTurnstileEvent` is actually a "force push" in that it
flushes the queue and, since it enqueues a turnstile event, the
flush's call to `postEvents` will attempt to send any queued events
even if telemetry is paused. This has the side effect of defeating
the other queue / timing / flush logic in place whenever map load
(and now implicitly turnstile) events are pushed.
@boundsj boundsj force-pushed the boundsj-send-turnstyle-on-map-load branch from 07755b6 to 9891d0e Compare February 15, 2016 19:44
@boundsj boundsj merged commit 9891d0e into master Feb 15, 2016
@boundsj boundsj deleted the boundsj-send-turnstyle-on-map-load branch February 15, 2016 20:02
@1ec5 1ec5 modified the milestones: ios-v3.3.0, ios-v3.2.0 Mar 3, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants