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: Connection Ready and Trackable Removal Requested #559

Open AndyTWF opened 1 year ago

AndyTWF commented 1 year ago

Implement the equivalents of the following AAT Android Workers:

The TrackableRemovalRequested worker is responsible for removing a trackable again once Ably connections have been made but the final steps (starting location updates etc in ConnectionReady) have not, and if since being added the trackable has been marked for removal. It posts TrackableRemovalSuccessWork, containing a success or failure result, depending on what it itself was passed.

Similar to DisconnectSuccess, it stops the ably connection if there are no other trackables. If an async error occurs, and we're in the process of disconnecting the ably connection, then StoppingConnectionFinished work is posted.

The ConnectionReadyWorker sets the publisher online, starts location updates and subscribes for channel state changes. If the trackable has been marked for removal, it calls ably.disconnect() and queues TrackableRemovalRequested with a success result.

If an async error occurs, TrackableRemovalRequested work is posted with a failure result.

On an synchronous error, FailTrackable work is posted.

This work depends on:

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-3372