A method and apparatus is provided for processing tasks with failure
recovery. The method includes storing one or more tasks in a queue,
wherein each task has an associated exit routine, and determining at
least one task to process based on a priority scheme. The method further
includes processing the at least one task, and calling the exit routine
based on determining that the task has not completed processing within a
preselected period of time.