From: Roland Häder Date: Sat, 25 Feb 2012 18:09:00 +0000 (+0000) Subject: Removed var_dump() called, added handleAvailableChunk() but unfinished with a die... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e1bd9f349e905e9545f1303592daed221f0611c4;p=hub.git Removed var_dump() called, added handleAvailableChunk() but unfinished with a die() call --- diff --git a/application/hub/interfaces/handler/chunks/class_HandleableChunks.php b/application/hub/interfaces/handler/chunks/class_HandleableChunks.php index 253e8b584..f19ee14c2 100644 --- a/application/hub/interfaces/handler/chunks/class_HandleableChunks.php +++ b/application/hub/interfaces/handler/chunks/class_HandleableChunks.php @@ -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] diff --git a/application/hub/main/handler/chunks/class_ChunkHandler.php b/application/hub/main/handler/chunks/class_ChunkHandler.php index a6826670b..06573bd81 100644 --- a/application/hub/main/handler/chunks/class_ChunkHandler.php +++ b/application/hub/main/handler/chunks/class_ChunkHandler.php @@ -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] diff --git a/application/hub/main/package/class_NetworkPackage.php b/application/hub/main/package/class_NetworkPackage.php index 0c28f7fc2..12487d829 100644 --- a/application/hub/main/package/class_NetworkPackage.php +++ b/application/hub/main/package/class_NetworkPackage.php @@ -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);