This class is designed to place users into a queue, so that only one user can execute some code at a time.
Eg. If you want a certain MySQL query to be executed at a time.
This is the MySQL table were the queue is stored. (Default: "queue")
The timeout on the queue, this is how long (in seconds) a user can be in the queue without calling the updateTime() function (Default: 2)
User id for the queue (This is automaticly generated or can be set)
The queue id
Time (in seconds [5 D.P]) the user has been in the queue. Set after waitInLine() function is called
void Queue(int $qid)
Initial function, sets the queue id.
void setQueueTable(str $queue_table) [Optional] Defailt: queue
Set the queue MySQL table
void setTimeout(int $timeout) [Optional] Default: 2
Sets the queue time-out
Puts the user into the queue
Removes the user from the queue
Returns the first person in the queue
Removes users from the queue which have timed-out
Updates the users queue time
Returns the queue time
Returns true if the user is in the queue.
This is were you 'wait in the line', this functions loops until either the user is at the top of the queue or has been remove (due to time-out) from the queue.
Returns true when everthing is ok (reached the top of the line) and false is the user has been kick out.