]> git.mxchange.org Git - hub.git/commitdiff
Now configurable static IPs are supported, Connectable rewritten, docs updated
authorRoland Häder <roland@mxchange.org>
Sun, 5 Sep 2010 08:48:11 +0000 (08:48 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 5 Sep 2010 08:48:11 +0000 (08:48 +0000)
19 files changed:
.gitattributes
application/hub/config.php
application/hub/exceptions/resolver/.htaccess [new file with mode: 0644]
application/hub/exceptions/resolver/class_NoValidHostnameException.php [new file with mode: 0644]
application/hub/interfaces/connectors/class_Connectable.php
application/hub/interfaces/visitor/connector/class_QueueConnectorVisitor.php [new file with mode: 0644]
application/hub/interfaces/visitor/queue/.htaccess [new file with mode: 0644]
application/hub/interfaces/visitor/queue/class_QueueVisitor.php [new file with mode: 0644]
application/hub/main/connectors/query/local/class_LocalQueryConnector.php
application/hub/main/connectors/queues/class_
application/hub/main/connectors/queues/local/class_LocalQueueConnector.php
application/hub/main/database/wrapper/class_PeerStateLookupDatabaseWrapper.php
application/hub/main/discovery/package/class_PackageRecipientDiscovery.php
application/hub/main/filter/task/class_TaskHandlerInitializerFilter.php
application/hub/main/nodes/class_BaseHubNode.php
application/hub/main/tools/class_HubTools.php
application/hub/main/visitor/tasks/class_ActiveTaskVisitor.php
application/hub/main/visitor/tasks/class_ShutdownTaskVisitor.php
docs/README

index 09963e53d6ff264c333eb04f04b997dc981a66ae..f5ed204e435e6aca7d096c9ed9aecdbf878dcc23 100644 (file)
@@ -18,6 +18,8 @@ application/hub/exceptions/lists/class_ListGroupAlreadyAddedException.php -text
 application/hub/exceptions/lists/class_NoListGroupException.php -text
 application/hub/exceptions/peer/.htaccess -text
 application/hub/exceptions/peer/class_PeerAlreadyRegisteredException.php -text
+application/hub/exceptions/resolver/.htaccess svneol=native#text/plain
+application/hub/exceptions/resolver/class_NoValidHostnameException.php svneol=native#text/plain
 application/hub/exceptions/state/.htaccess -text
 application/hub/exceptions/state/class_InvalidStateException.php -text
 application/hub/exceptions/tags/.htaccess -text
@@ -77,6 +79,7 @@ application/hub/interfaces/visitor/class_Visitable.php -text
 application/hub/interfaces/visitor/class_Visitor.php -text
 application/hub/interfaces/visitor/connector/.htaccess -text
 application/hub/interfaces/visitor/connector/class_QueryConnectorVisitor.php -text
+application/hub/interfaces/visitor/connector/class_QueueConnectorVisitor.php svneol=native#text/plain
 application/hub/interfaces/visitor/decorator/.htaccess -text
 application/hub/interfaces/visitor/decorator/class_DecoratorVisitor.php -text
 application/hub/interfaces/visitor/listener/.htaccess -text
@@ -87,6 +90,8 @@ application/hub/interfaces/visitor/pool/listener/.htaccess -text
 application/hub/interfaces/visitor/pool/listener/class_ListenerPoolVisitor.php -text
 application/hub/interfaces/visitor/query/.htaccess -text
 application/hub/interfaces/visitor/query/class_QueryVisitor.php -text
+application/hub/interfaces/visitor/queue/.htaccess svneol=native#text/plain
+application/hub/interfaces/visitor/queue/class_QueueVisitor.php svneol=native#text/plain
 application/hub/interfaces/visitor/tasks/.htaccess -text
 application/hub/interfaces/visitor/tasks/class_TaskVisitor.php -text
 application/hub/loader.php -text
index 2659f0ee9b927610f8eb462bc9efd3caeb9cf5dd..68a1b48905b8a8bf331dcc9b222d5bbe78bed86b 100644 (file)
@@ -282,6 +282,15 @@ $cfg->setConfigEntry('task_query_handler_interval_delay', 10);
 // CFG: TASK-QUERY-HANDLER-MAX-RUNS
 $cfg->setConfigEntry('task_query_handler_max_runs', 0);
 
+// CFG: TASK-QUEUE-HANDLER-STARTUP-DELAY
+$cfg->setConfigEntry('task_queue_handler_startup_delay', 1000);
+
+// CFG: TASK-QUEUE-HANDLER-INTERVAL-DELAY
+$cfg->setConfigEntry('task_queue_handler_interval_delay', 10);
+
+// CFG: TASK-QUEUE-HANDLER-MAX-RUNS
+$cfg->setConfigEntry('task_queue_handler_max_runs', 0);
+
 // CFG: TASK-IDLE-LOOP-STARTUP-DELAY
 $cfg->setConfigEntry('task_idle_loop_startup_delay', 0);
 
@@ -444,5 +453,8 @@ $cfg->setConfigEntry('peer_state_checked_package_class', 'NewConnectionPeerState
 // CFG: SESSION-ID
 $cfg->setConfigEntry('session_id', '');
 
+// CFG: EXTERNAL-IP
+$cfg->setConfigEntry('external_ip', 'free-search.homelinux.org');
+
 // [EOF]
 ?>
diff --git a/application/hub/exceptions/resolver/.htaccess b/application/hub/exceptions/resolver/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/exceptions/resolver/class_NoValidHostnameException.php b/application/hub/exceptions/resolver/class_NoValidHostnameException.php
new file mode 100644 (file)
index 0000000..a6af1e5
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+/**
+ * This exception is thrown when a hash is invalid
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @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
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class NoValidHostnameException extends FrameworkException {
+       /**
+        * The super constructor for all exceptions
+        *
+        * @param       $hostName       Hostname:port array
+        * @param       $code           Error code
+        * @return      void
+        */
+       public function __construct (array $hostName, $code) {
+               // Construct the message
+               $message = sprintf("Hostname %s cannot be resolved. Port=%d",
+                       $hostName[0],
+                       $hostName[1]
+               );
+
+               // Call parent exception constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
index bd6e7c4a13a40b85de5037ded81b81230ed64e3c..cbce5c9de2039116e35cf0d97ec354e823fe87bc 100644 (file)
  */
 interface Connectable extends FrameworkInterface {
        /**
-        * Handles all pending queries. This method should be called by the
-        * ActiveTaskVisitor class and should use an iterator on all pending
-        * queries.
+        * Handles all pending requests/what ever. This method should be called by
+        * the ActiveTaskVisitor class and should use an iterator on all pending
+        * requests/queries/queues.
         *
         * @return      void
         */
-       function handlePendingQueries ();
+       function handlePanding ();
 }
 
 // [EOF]
diff --git a/application/hub/interfaces/visitor/connector/class_QueueConnectorVisitor.php b/application/hub/interfaces/visitor/connector/class_QueueConnectorVisitor.php
new file mode 100644 (file)
index 0000000..f4fb4d9
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+/**
+ * An interface for the visitor implementation for queue connectors
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @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
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface QueueConnectorVisitor extends Visitor {
+       /**
+        * QueueConnector visitor method for active queries
+        *
+        * @param       $connectorInstance      A Connectable instance
+        * @return      void
+        */
+       function visitQueueConnector (Connectable $connectorInstance);
+}
+
+// [EOF]
+?>
diff --git a/application/hub/interfaces/visitor/queue/.htaccess b/application/hub/interfaces/visitor/queue/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/interfaces/visitor/queue/class_QueueVisitor.php b/application/hub/interfaces/visitor/queue/class_QueueVisitor.php
new file mode 100644 (file)
index 0000000..10bf7b4
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+/**
+ * An interface for the visitor implementation for queues
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @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
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface QueueVisitor extends Visitor {
+       /**
+        * Queue visitor method for active queues
+        *
+        * @param       $QueueInstance  A Queueable instance
+        * @return      void
+        */
+       function visitQueue (Queueable $queueInstance);
+}
+
+// [EOF]
+?>
index a215d3a31ee58ced5a9b89b01c846f777db7a278..11577ddb50a5ff4a7b8d4e4ddc7cb12df8a7eca9 100644 (file)
@@ -75,7 +75,7 @@ class LocalQueryConnector extends BaseQueryConnector implements Connectable, Vis
         * query processor instance
         *
         * @return      void
-        * @TODO Unfinished work here
+        * @TODO        0% done: Unfinished work here
         */
        private function handleCurrentQuery () {
                // Is there a query available?
@@ -112,7 +112,7 @@ class LocalQueryConnector extends BaseQueryConnector implements Connectable, Vis
         *
         * @return      void
         */
-       public function handlePendingQueries () {
+       public function handlePanding () {
                // Should we rewind?
                if (!$this->getIteratorInstance()->valid()) {
                        // Rewind to the beginning for next loop
index 216eaa69551d969cd95b45ff5ed79720c81d29f8..e71fa1e45ce56819a57cf461f9c9684844f65182 100644 (file)
@@ -21,7 +21,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class ???QueueConnector extends BaseQueueConnector implements Connectable, Queueable {
+class ???QueueConnector extends BaseQueueConnector implements Connectable, Queueable, Visitable {
        /**
         * Protected constructor
         *
@@ -44,6 +44,17 @@ class ???QueueConnector extends BaseQueueConnector implements Connectable, Queue
                // Finally return it
                return $connectorInstance;
        }
+
+       /**
+        * Accepts the visitor to process the visit "request"
+        *
+        * @param       $visitorInstance        An instance of a Visitor class
+        * @return      void
+        */
+       public function accept (Visitor $visitorInstance) {
+               // Visit the query connector
+               $visitorInstance->visitQueue($this);
+       }
 }
 
 // [EOF]
index 30f4f91e9d011ba544e200ae7a7346277829ad49..c97b4cf6d229d158b561e1b9626aff7051dd336b 100644 (file)
@@ -21,7 +21,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class LocalQueueConnector extends BaseQueueConnector implements Connectable, Queueable {
+class LocalQueueConnector extends BaseQueueConnector implements Connectable, Queueable, Visitable {
        /**
         * Protected constructor
         *
@@ -49,6 +49,59 @@ class LocalQueueConnector extends BaseQueueConnector implements Connectable, Que
                // Finally return it
                return $connectorInstance;
        }
+
+       /**
+        * Handles the in the list avaiable queues (current) and hands it over to the
+        * queues processor instance
+        *
+        * @return      void
+        * @TODO        0% done: Unfinished work here
+        */
+       private function handleCurrentQueues () {
+               // Is there a queues available?
+               if (!$this->getIteratorInstance()->valid()) {
+                       // Simply abort here
+                       return;
+               } // END - if
+
+               // Get the current queues
+               $currentQueues = $this->getIteratorInstance()->current();
+
+               // Only while construction, else it would output to much!
+               /* DEBUG: */ $this->debugOutput('CONNECTOR: Handling queue entry ' . $currentQueues);
+       }
+
+       /**
+        * Handles all pending queues. This method should be called by the
+        * ActiveTaskVisitor class and should use an iterator on all pending
+        * queues.
+        *
+        * @return      void
+        */
+       public function handlePanding () {
+               // Should we rewind?
+               if (!$this->getIteratorInstance()->valid()) {
+                       // Rewind to the beginning for next loop
+                       $this->getIteratorInstance()->rewind();
+               } // END - if
+
+               // Try to execute the task
+               $this->handleCurrentQueue();
+
+               // Go to next entry
+               $this->getIteratorInstance()->next();
+       }
+
+       /**
+        * Accepts the visitor to process the visit "request"
+        *
+        * @param       $visitorInstance        An instance of a Visitor class
+        * @return      void
+        */
+       public function accept (Visitor $visitorInstance) {
+               // Visit the query connector
+               $visitorInstance->visitQueue($this);
+       }
 }
 
 // [EOF]
index d1f44cea0b5c0948109f3f78e3a8a00be1127a03..03fe0217e65429cd3a1a1ccd964f5de84a07e415 100644 (file)
@@ -78,6 +78,12 @@ class PeerStateLookupDatabaseWrapper extends BaseDatabaseWrapper {
                // Is always new peer by default
                $isNewPeer = true;
 
+               // Is the package valid?
+               if (!isset($packageData[NetworkPackage::INDEX_PACKAGE_SENDER])) {
+                       // Invalid package found, please report this
+                       die('packageData='.print_r($packageData, true));
+               } // END - if
+
                // Remove session id > IP:port
                $ipPort = HubTools::resolveSessionId($packageData[NetworkPackage::INDEX_PACKAGE_SENDER]);
 
index d2dfcb6d2ea52a4a6d49bfd15172680d8205c4a0..c0d256556cee6fb6704d3524311aeb9a471596c7 100644 (file)
@@ -71,8 +71,14 @@ class PackageRecipientDiscovery extends BaseHubDiscovery implements Discoverable
 
                        // The target 'self' is always the external IP address!
                        case NetworkPackage::NETWORK_TARGET_SELF:
-                               // Determine own external ip by connecting to my (coder) server at 217.172.186.31
-                               $ip = ConsoleTools::determineExternalIp();
+                               // Is the external_ip config entry set?
+                               if ($this->getConfigInstance()->getConfigEntry('external_ip') != '') {
+                                       // Use it as external ip
+                                       $ip = $this->getConfigInstance()->getConfigEntry('external_ip');
+                               } else {
+                                       // Determine own external ip by connecting to my (coder) server at 217.172.186.31
+                                       $ip = ConsoleTools::determineExternalIp();
+                               }
 
                                // Get mode
                                $mode = Registry::getRegistry()->getInstance('app')->getRequestInstance()->getRequestElement('mode');
index 4a2dff8563e40b2d98c6a1e997d7532f0b6d7fb4..3310eca6407378fdfbbeb62d16f22c0e9b50b457 100644 (file)
@@ -79,6 +79,9 @@ class TaskHandlerInitializerFilter extends BaseFilter implements Filterable {
                // Query handler instance
                $handlerInstance->registerTask('query_handler', $nodeInstance->getQueryConnectorInstance());
 
+               // Queue handler instance
+               $handlerInstance->registerTask('queue_handler', $nodeInstance->getQueueConnectorInstance());
+
                // Put the task handler in registry
                Registry::getRegistry()->addInstance('task', $handlerInstance);
 
index b83b93c9743c3e6c2497ff88ec77e0b4289921f9..469cc87ff981b17184248bca93545fdd9b7edf1a 100644 (file)
@@ -33,7 +33,12 @@ class BaseHubNode extends BaseHubSystem implements Updateable {
        /**
         * Query connector instance
         */
-       private $connectorInstance = null;
+       private $queryConnectorInstance = null;
+
+       /**
+        * Queue connector instance
+        */
+       private $queueConnectorInstance = null;
 
        /**
         * Listener pool instance
@@ -166,7 +171,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable {
         * @return      void
         */
        private final function setQueryConnectorInstance (Connectable $connectorInstance) {
-               $this->connectorInstance = $connectorInstance;
+               $this->queryConnectorInstance = $connectorInstance;
        }
 
        /**
@@ -175,7 +180,26 @@ class BaseHubNode extends BaseHubSystem implements Updateable {
         * @return      $connectorInstance              Our new query instance
         */
        public final function getQueryConnectorInstance () {
-               return $this->connectorInstance;
+               return $this->queryConnectorInstance;
+       }
+
+       /**
+        * Setter for queue instance
+        *
+        * @param       $connectorInstance              Our new queue instance
+        * @return      void
+        */
+       private final function setQueueConnectorInstance (Connectable $connectorInstance) {
+               $this->queueConnectorInstance = $connectorInstance;
+       }
+
+       /**
+        * Getter for queue instance
+        *
+        * @return      $connectorInstance              Our new queue instance
+        */
+       public final function getQueueConnectorInstance () {
+               return $this->queueConnectorInstance;
        }
 
        /**
@@ -377,6 +401,12 @@ class BaseHubNode extends BaseHubSystem implements Updateable {
                // Run a test query
                $this->getQueryConnectorInstance()->doTestQuery();
 
+               // Set the queue connector instance
+               $this->setQueueConnectorInstance(ObjectFactory::createObjectByConfiguredName('queue_connector_class', array($this)));
+
+               // Run a test queue
+               $this->getQueueConnectorInstance()->doTestQueue();
+
                // Debug message
                $this->debugOutput('BOOTSTRAP: Initialize queues: FINISHED');
        }
index 4525f503e2ae72707d1c2da747c4f9f28b5a068a..bf11d00975b39b1047ed84043fbc47484eadfc1f 100644 (file)
@@ -24,6 +24,7 @@
 class HubTools extends BaseFrameworkSystem {
        // Constants for exceptions
        const EXCEPTION_SESSION_ID_IS_INVALID = 0x200;
+       const EXCEPTION_HOSTNAME_NOT_FOUND    = 0x201;
 
        /**
         * Cache for session ids
@@ -101,6 +102,7 @@ class HubTools extends BaseFrameworkSystem {
         * @param       $sessionId      Session id or ip:port combination
         * @return      $recipient      Recipient as ip:port combination
         * @throws      InvalidSessionIdException       If the provided session id is invalid (and no ip:port combination)
+        * @throws      NoValidHostnameException        If the provided hostname cannot be resolved into an IP address
         */
        public static function resolveSessionId ($sessionId) {
                // Get an own instance
@@ -118,6 +120,19 @@ class HubTools extends BaseFrameworkSystem {
 
                                // Then use it
                                $recipient = $selfInstance->sessionIdCache[$sessionId];
+                       } elseif (preg_match('/([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}/', $sessionId)) {
+                               // Hostname:port found
+                               $hostnameArray = explode(':', $sessionId);
+
+                               // Try to resolve it and add port again
+                               // @TODO We may want to encapsulate this PHP call into an own class
+                               $recipient = gethostbyname($hostnameArray[0]) . ':' . $hostnameArray[1];
+
+                               // Is it valid?
+                               if ($recipient == $sessionId) {
+                                       // Resolving hostname->IP failed!
+                                       throw new NoValidHostnameException($hostnameArray, self::EXCEPTION_HOSTNAME_NOT_FOUND);
+                               } // END - if
                        } elseif (!preg_match('/([a-f0-9]{' . $selfInstance->getSessionIdLength() . '})/', $sessionId)) {
                                // Invalid session id
                                throw new InvalidSessionIdException($sessionId, self::EXCEPTION_SESSION_ID_IS_INVALID);
index 9b645114af996eb2b91ade489b0e73505a58d766..f38b600d28e9093966ca3e6bb34e82564aeb374a 100644 (file)
@@ -21,7 +21,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class ActiveTaskVisitor extends BaseVisitor implements TaskVisitor, QueryConnectorVisitor, PoolVisitor, ListenerVisitor, DecoratorVisitor {
+class ActiveTaskVisitor extends BaseVisitor implements TaskVisitor, QueryConnectorVisitor, QueueConnectorVisitor, PoolVisitor, ListenerVisitor, DecoratorVisitor {
        /**
         * Protected constructor
         *
@@ -69,7 +69,18 @@ class ActiveTaskVisitor extends BaseVisitor implements TaskVisitor, QueryConnect
         */
        public function visitQueryConnector (Connectable $connectorInstance) {
                // Process all pending queries
-               $connectorInstance->handlePendingQueries();
+               $connectorInstance->handlePanding();
+       }
+
+       /**
+        * Connector visitor method for active tasks
+        *
+        * @param       $connectorInstance      A Connectable instance
+        * @return      void
+        */
+       public function visitQueueConnector (Connectable $connectorInstance) {
+               // Process all pending queries
+               $connectorInstance->handlePanding();
        }
 
        /**
@@ -97,6 +108,17 @@ class ActiveTaskVisitor extends BaseVisitor implements TaskVisitor, QueryConnect
                // Empty for now...
        }
 
+       /**
+        * Queue visitor method for active queries
+        *
+        * @param       $queueInstance  A Queueable instance
+        * @return      void
+        * @todo        Does a queue needs to perform some actions as an active task?
+        */
+       public function visitQueue (Queueable $queueInstance) {
+               // Empty for now...
+       }
+
        /**
         * Visits the given listener instance
         *
index cf1753f497eb87ba44e6af4c6d3ee52f7ceb0d49..92ef09c87f629b26e6e85e98525be53ac9da00d2 100644 (file)
@@ -21,7 +21,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class ShutdownTaskVisitor extends BaseVisitor implements TaskVisitor, QueryConnectorVisitor, PoolVisitor, ListenerVisitor, DecoratorVisitor {
+class ShutdownTaskVisitor extends BaseVisitor implements TaskVisitor, QueryConnectorVisitor, QueueConnectorVisitor, PoolVisitor, ListenerVisitor, DecoratorVisitor {
        /**
         * Protected constructor
         *
@@ -70,6 +70,17 @@ class ShutdownTaskVisitor extends BaseVisitor implements TaskVisitor, QueryConne
                $connectorInstance->doShutdown();
        }
 
+       /**
+        * Connector visitor method for active tasks
+        *
+        * @param       $connectorInstance      A Connectable instance
+        * @return      void
+        */
+       public function visitQueueConnector (Connectable $connectorInstance) {
+               // Shutdown the connector instance
+               $connectorInstance->doShutdown();
+       }
+
        /**
         * Pool visitor method for active tasks
         *
@@ -93,6 +104,18 @@ class ShutdownTaskVisitor extends BaseVisitor implements TaskVisitor, QueryConne
                $queryInstance->doShutdown();
        }
 
+       /**
+        * Queue visitor method for active queries
+        *
+        * @param       $queueInstance  A Queueable instance
+        * @return      void
+        * @todo        Does a queue needs to perform some actions as an active task?
+        */
+       public function visitQueue (Queueable $queueInstance) {
+               // Shutdown the queue instance
+               $queueInstance->doShutdown();
+       }
+
        /**
         * Visits the given listener instance
         *
index a2313e88310ceba2ef8e737039c0287ddba9e48f..fbc1067586de2fe2697d5179dd63f75e76380e7b 100644 (file)
@@ -6,8 +6,8 @@ README
 --------------------------------------------------------------------------------
 
 At the current stage of code base you need to launch the hub by entering the
-following command at at command prompt (Win32) or console (Linux etc.) in the
-root directory of this script:
+following command at a command prompt (Win32) or console (Linux, etc.) in the
+root directory:
 
 php index.php app=hub