This class can be used to manage a queue of users competing to execute a task that can only be run by a single user at a time.
The class stores in a MySQL table the queue of users that want to execute a task.
An entry in the queue table is added for each user that wants to run the task.
While the current user is not the next to run the task, he must wait for his turn.
When the first user in the queue finishes to run the task, its queue entry is deleted to pass the turn to the next user in the queue. |