]> git.mxchange.org Git - hub.git/commitdiff
Removed var_dump() called, added handleAvailableChunk() but unfinished with a die...
authorRoland Häder <roland@mxchange.org>
Sat, 25 Feb 2012 18:09:00 +0000 (18:09 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 25 Feb 2012 18:09:00 +0000 (18:09 +0000)
application/hub/interfaces/handler/chunks/class_HandleableChunks.php
application/hub/main/handler/chunks/class_ChunkHandler.php
application/hub/main/package/class_NetworkPackage.php

index 253e8b5848b3128eb427062915c07eb825a88286..f19ee14c208a6a8799d70fc0af693e20adb58450 100644 (file)
@@ -30,6 +30,15 @@ interface HandleableChunks extends Handleable {
         * @throws      FinalChunkVerificationException         If the final chunk does not start with 'EOP:'
         */
        function addAllChunksWithFinal (array $chunks);
+
+       /**
+        * Handles available chunks by processing one-by-one (not all together,
+        * this would slow-down the whole application) with the help of an
+        * iterator.
+        *
+        * @return      void
+        */
+       function handleAvailableChunks ();
 }
 
 // [EOF]
index a6826670b6ab2278b494bc73a8d6f9cdba9d212d..06573bd812863ccb81fa9bdd577852c11feacbd6 100644 (file)
@@ -95,6 +95,22 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable
                // Return result
                return $unhandledChunks;
        }
+
+       /**
+        * Handles available chunks by processing one-by-one (not all together,
+        * this would slow-down the whole application) with the help of an
+        * iterator.
+        *
+        * @return      void
+        */
+       public function handleAvailableChunks () {
+               // First check if there are undhandled chunks available
+               assert($this->ifUnhandledChunksAvailable());
+
+               // Get an entry from the stacker
+               $chunk = $this->getStackerInstance()->getNamed(self::STACKER_NAME_CHUNKS_WITH_FINAL_EOP);
+               die('chunk=' . $chunk . chr(10));
+       }
 }
 
 // [EOF]
index 0c28f7fc2da9248b8132bd5511a78e3a323c1fc2..12487d829b2d8078ba5e975a4e94dcd36c425302 100644 (file)
@@ -299,7 +299,6 @@ class NetworkPackage extends BaseFrameworkSystem implements Deliverable, Receiva
 
                        // Set the recipient
                        $packageData[self::PACKAGE_DATA_RECIPIENT] = $currentRecipient;
-                       var_dump($packageData);
 
                        // And enqueue it to the writer class
                        $this->getStackerInstance()->pushNamed(self::STACKER_NAME_DECLARED, $packageData);