1 package org.daisy.pipeline.tts.scheduler;
2
3 /**
4 * Scheduler interface to launch schedulable actions.
5 *
6 * <p>A schedulable action must be reschedule when a RecoverableError is raised.</p>
7 *
8 * <p>An example of implementation is provided in the ExponentialBackoffScheduler</p>
9 *
10 * @author Louis Caille @ braillenet
11 *
12 * @param <Action> the schedulable action class to handle
13 */
14 public interface Scheduler<Action extends Schedulable> {
15
16 /**
17 * Launch an action from the queue.
18 *
19 * @param scheduled the action to launch
20 * @throws InterruptedException if the scheduler thread is interrupted
21 * @throws FatalError if the action could not be executed or rescheduled after a RecoverableError
22 */
23 public void launch(Action scheduled) throws InterruptedException, FatalError;
24
25 }