lytics / ios-sdk

MIT License
0 stars 0 forks source link

Add Loader #88

Closed mgacy closed 1 year ago

mgacy commented 1 year ago

Defines a Loader which is responsible for performing requests for the SDK consumer. This differs from the existing Uploader in that it will sit outside the EventPipeline, does not cache failed requests to retry later, and will return responses to the consumer. The live implementation uses a new Task.retrying(priority:maxRetryCount:shouldRetry:operation:) method to retry failed requests. This method does not currently support exponential backoff or any other delay strategy. It might be worth discussing this decision.

This also adds an EntityIdentifier type representing the need for both a field name and a field value for entity requests. The next PR will add the following method to Lytics in order to fetch the user profile user the Loader

func getProfile(_ identifier: EntityIdentifier? = nil) async throws -> LyticsUser

Finally, this includes some changes to the parameters of the live methods for EventPipeline and EventQueue that reflect how dependencies will be passed along with the introduction of the Loader type.