So we have a program that has a pause button in the main UI. When the pause button is pressed a time stamp is saved and when pressed again another timestamp is then created, the time diff between the two is calculated and then then all 3 values along with a user name are sent to a db using WebClient
. The problem is that if the button is pressed multiple times rapidly the there are issues with getting all the data sent.
I had the idea to make a queue and instead of the pause button sending the data it would write it to a queue and then have a separate thread check the queue and handle the handle the sending.
Using a timer to fire a background worker every x-seconds for the simple task of reading a queue and sending data if its there feels like overkill/abuse. Am I right and this is more of regular thread kind of job or is the background worker the way to go?