]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/pools/class_BasePool.php
Better TCP listener implemented, client pool added, some code moves
[hub.git] / application / hub / main / pools / class_BasePool.php
index 908d1942c1619bef356f6c53c335336bcae8d57f..efa9aa9da21c325be497c96c860477499129fa51 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 class BasePool extends BaseHubSystem {
+       /**
+        * A list of pool entries
+        */
+       private $poolEntries = array();
+
        /**
         * Protected constructor
         *
@@ -32,6 +37,29 @@ class BasePool extends BaseHubSystem {
                // Call parent constructor
                parent::__construct($className);
        }
+
+       /**
+        * Adds an instance to a pool segment
+        *
+        * @param       $group                  Name of the pool group
+        * @param       $poolSegment    Name of the pool segment
+        * @param       $instance               An instance of a class we should add to the pool
+        * @return      void
+        * @todo        Can we use Listenable instead of FrameworkInterface ?
+        */
+       protected final function addInstance($group, $poolName, FrameworkInterface $instance) {
+               $this->poolEntries[$group][$poolName][] = $instance;
+       }
+
+       /**
+        * Adds an entry to the pool
+        *
+        * @param       $poolEntry      The new pool entry we should add
+        * @return      void
+        */
+       protected final function addPoolEntry ($poolEntry) {
+               $this->poolEntries[] = $poolEntry;
+       }
 }
 
 // [EOF]