Added accept() and doShutdown() to Taskable as this will always be needed.
authorRoland Haeder <roland@mxchange.org>
Wed, 10 Jun 2015 18:10:41 +0000 (20:10 +0200)
committerRoland Haeder <roland@mxchange.org>
Wed, 10 Jun 2015 18:10:41 +0000 (20:10 +0200)
Signed-off-by: Roland H├Ąder <roland@mxchange.org>
inc/classes/interfaces/tasks/class_Taskable.php
inc/classes/main/tasks/class_
inc/classes/main/tasks/idle/class_IdleLoopTask.php

index 9ec1a71..b1915b9 100644 (file)
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 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]
index daacdeb..1bbb87e 100644 (file)
@@ -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]
index f07b0e8..0dd2de9 100644 (file)
@@ -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...');
        }
 }