X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=application%2Fhub%2Finterfaces%2Fhandler%2Ftask%2Fclass_HandleableTask.php;h=4aaceba712b4d266ab0a80fc0968fbc5f02f5aad;hb=aa4ac5d61eab8540e9902396998f3f53718eeaf5;hp=f805475ca4cf9e234b48db604314b396e6ff4b35;hpb=49a3d50a9f304acf735e6cc2513b334cb11447ed;p=hub.git diff --git a/application/hub/interfaces/handler/task/class_HandleableTask.php b/application/hub/interfaces/handler/task/class_HandleableTask.php index f805475ca..4aaceba71 100644 --- a/application/hub/interfaces/handler/task/class_HandleableTask.php +++ b/application/hub/interfaces/handler/task/class_HandleableTask.php @@ -4,7 +4,7 @@ * * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team * @license GNU GPL 3.0 or any newer version * @link http://www.ship-simu.org * @@ -26,13 +26,29 @@ interface HandleableTask extends Handleable { * Registers a task with a task handler. This method throws a * TaskAlreadyRegisteredException if the task has already been registered * - * @param $taskName A task name to register the task on + * @param $taskName A task name to register the task on * @param $taskInstance The instance we should register as a task * @return void - * @throws TaskAlreadyRegisteredException If the given task is already registered */ function registerTask ($taskName, Visitable $taskInstance); + + /** + * Checks wether tasks are left including idle task. + * + * @return $tasksLeft Wether there are tasks left to handle + */ + function hasTasksLeft (); + + /** + * Handles all tasks by checking if they should startup or if it is their + * turn to run. You should use this method in a while() loop in conjuntion + * with hasTasksLeft() so you can e.g. shutdown by adding a ShutdownTask + * which will attempt to remove all tasks from the task handler. + * + * @return void + */ + function handleTasks (); } -// +// [EOF] ?>