From: Roland Haeder Date: Wed, 10 Jun 2015 18:10:41 +0000 (+0200) Subject: Added accept() and doShutdown() to Taskable as this will always be needed. X-Git-Url: https://git.mxchange.org/?p=core.git;a=commitdiff_plain;h=df1b3a826bc67c252efaaac93cb8e78b2cb29603;hp=9aeecff34797942ce8d4ce03a2dc966dc1dbf702 Added accept() and doShutdown() to Taskable as this will always be needed. Signed-off-by: Roland Häder --- diff --git a/inc/classes/interfaces/tasks/class_Taskable.php b/inc/classes/interfaces/tasks/class_Taskable.php index 9ec1a711..b1915b92 100644 --- a/inc/classes/interfaces/tasks/class_Taskable.php +++ b/inc/classes/interfaces/tasks/class_Taskable.php @@ -22,12 +22,27 @@ * along with this program. If not, see . */ interface Taskable extends FrameworkInterface { + /** + * Accepts the visitor to process the visitor + * + * @param $visitorInstance An instance of a Visitor class + * @return void + */ + function accept (Visitor $visitorInstance); + /** * Executes the task * * @return void */ function executeTask (); + + /** + * Shuts down the task + * + * @return void + */ + function doShutdown (); } // [EOF] diff --git a/inc/classes/main/tasks/class_ b/inc/classes/main/tasks/class_ index daacdebd..1bbb87e2 100644 --- a/inc/classes/main/tasks/class_ +++ b/inc/classes/main/tasks/class_ @@ -66,6 +66,16 @@ class !!!???Task extends BaseTask implements Taskable, Visitable { public function executeTask () { $this->partialStub('Unimplemented task.'); } + + /** + * Shuts down the task + * + * @return void + * @todo 0% done + */ + public function doShutdown () { + self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + } } // [EOF] diff --git a/inc/classes/main/tasks/idle/class_IdleLoopTask.php b/inc/classes/main/tasks/idle/class_IdleLoopTask.php index f07b0e89..0dd2de9f 100644 --- a/inc/classes/main/tasks/idle/class_IdleLoopTask.php +++ b/inc/classes/main/tasks/idle/class_IdleLoopTask.php @@ -73,7 +73,7 @@ class IdleLoopTask extends BaseTask implements Taskable, Visitable { */ public function doShutdown () { // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('IDLE-TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } }