I have an application that allows my users to schedule various tasks to run at certain times. Each task is broken into sub-tasks representing chunks of work. For example, imagine a task with a series of subtasks like this:
- Download files to server from an FTP location
- Process the files
- Push the processed files into a database
- Clean up
I would like to carefully track the status of these running tasks as they progress though their steps, both for informational purposes and also to maintain state so tasks that fail can be re-tried (for example, imagine the database is down so it fails on subtask 3 above. Once the DB is up again, I'd want to be able to retry it so it would pick up exactly where it left off)
What kind of design pattern or framework would you recommend to best accomplish this as cleanly as possible? I'm using DI with Castle Windsor for quite a bit of my application already so I'd like to integrate it with that so I can easily swap out the implementation for how the state of each task is stored.
Aucun commentaire:
Enregistrer un commentaire