This does not sound too complicated; just specify a timestamp that you can sort whenever tasks are set. Depending on the database, this field may be autocomplete with the current timestamp.
When retrieving jobs, it is as simple as including SELECT and DELETE statements in a transaction. If you feel this is uncomfortable, something like this might do it:
UPDATE tblQueue SET mark = <unique application id> WHERE mark IS NULL ORDER BY timestamp ASC LIMIT 1 SELECT * FROM tblQueue WHERE mark = <unique app id> DELETE FROM tblQueue WHERE mark = <unique app id>
Using this setting, you can avoid transactions if they scare you.
Your definition of the party is somewhat fuzzy; if you just want me to be able to process 10 elements at a time, just change the LIMIT 1 clause of the first query to LIMIT 10.
If you mean that tasks can be grouped, you probably need a task queue and place sub-elements in another table (this is not a queue, just a regular table with a foreign key pointing to a task element).
source share