ably / ably-asset-tracking-swift

iOS client SDKs for the Ably Asset Tracking service.
Apache License 2.0
9 stars 6 forks source link

Publisher Worker Queue: Enhanced Location Updates #543

Open AndyTWF opened 1 year ago

AndyTWF commented 1 year ago

Implement the following workers from AAT Android:

These workers are concerned with the generation of enhanced location updates by Mapbox and sending it to subscribers over the ably connection.

The EnhancedLocationChanged worker processes the location update for each trackable - requesting the publisher send it over the ably connection, emits the location on the publishers locations feed and also initiates a threshold check to see if the trackable is within proximity of the destination.

As a result of the publisher sending the enhanced location over the ably connection, the publisher then posts one of two workers:

On a successful send, SendEnhancedLocationSuccess is posted. This work unmarks the trackable as having a pending message, updates the last sent enhanced location for the trackable and clears any skipped locations. It then tells the publisher to publish the next location update (if one is pending).

On a failed send, SendEnhancedLocationFailure is posted. If the error is not a fatal connection error and we've not passed the max retry count - then the publisher should be instructed to retry sending. Otherwise the update should be unmarked as pending and added to skipped locations for future sending. The publisher should then be instructed to send the next location update (if one is pending).

Current differences to the AAT Android implementation:

It would be worthwhile keeping an eye on the process/decisions of #542 as this will be very similar work

sync-by-unito[bot] commented 1 year ago

➤ Automation for Jira commented:

The link to the corresponding Jira issue is https://ably.atlassian.net/browse/SDK-3354