fterrier/kevin — pull request #215 by fterrier (2012-07-20 09:06:11+00:00)
Title: Worker jobs for calculate task

added a Task mechanism and the following functionality:
- a TaskController whose role is to add a task and dispatch it to a rabbitMQ worker queue for processing. The controller makes sure there is always only one unique task that is NEW or IN_PROGRESS. COMPLETED tasks are just there for information and are ignored in the whole logic.
- a TaskService that takes care of handling the messages from the queue and running the associated tasks, at the moment, the number of concurrent worker is set to 1 in Config.groovy

also added some mechanism in case the queue fails or the grails application is restarted:
- a Bootstrap routine that clears the queue, takes all the tasks and adds them back to the queue for processing in case the server is restarted
- a TaskJob that runs every 2 minutes and checks which Tasks have not yet been sent to the queue, and sends them. This makes sure tasks will be sent for processing if rabbitMQ was not running when the task was added and started later.

Next on the TODO list:
- Add an AJAX progress information on the admin list page
- Add a "remove all completed" link on the admin list page
- Add a cron job each night that also removes all the completed tasks from the admin list
- Add a rabbitMQ status on list page, in case it is not running, one can contact an administrator
- Implement progress report in RefreshValueService
- Implement Tasks with output (like the export/import)
- Implement remaining tasks: import, export, submit, refresh all, etc...