| Path: | app/models/submission_collector.rb |
| Last Update: | Wed Jul 21 16:02:24 -0400 2010 |
A signleton class responsible for collecting submissions from groupings.
The SubmissionCollector keeps track of groupings it needs to collect submissions from via two queues, one regular queue to keep track of groupings whose submissions need to be collected. The second queue is the priority queue, whose members’ submissions get collected ahead of the ones in the regular queue.
The actual creation of the submissions for the grouping is done inside a forked process due to the length of time taken to collect submissions with pdf files in them.
The collector updates the groupings to let them know if they are in queue for collection, in order to figure out if their current submission is the latest one, or theres a newer one waiting to be collected.
Both queues are stored in the database to allow for easy parent-child process communication bypassing the need for pipes or signals.