I have a function readData reading data from HealthKit that takes a few seconds to execute. This function can be called from multiple threads/places, but I want each call to execute in a queue, one at a time, rather than in parallel.
Is there a simple way to use GCD or OperationQueues to achieve this in Swift for iOS?