Greetings,
I have a Mac OS application, written in Swift, that needs to send out timing messages periodically. I have written it to use a DispatchSourceTimer whose handler sends out UDP packets over the network. As long as the application is in the foreground, all works as expected and the packets get sent in a timely manner. However, if another application becomes the foreground application, then after some time the timer will start to fire sporadically, missing most of its deadlines.
I suspect that I need to create my own DispatchQueue for the timer with an appropriate QoS setting that make it continue to run with high enough priority even when my app is in the background, but the documentation is sketchy as to exacly what the different QoS levels mean and which one will accomplish what I need.
Suggestions?
Thanks,
--Douglas Mandell