/**
* By default no cruncher is active
*/
- private $isActive = false;
+ private $isActive = FALSE;
/**
* All buffer queue instances (a FIFO)
*/
private $bufferInstance = NULL;
+ /**
+ * Stacker name for incoming queue
+ */
+ const STACKER_NAME_IN_QUEUE = 'in_queue';
+
+ /**
+ * Stacker name for outcoming queue
+ */
+ const STACKER_NAME_OUT_QUEUE = 'out_queue';
+
/**
* Protected constructor
*
*/
protected function isInBufferQueueFilled () {
// Determine it
- $isFilled = ($this->bufferInstance->getStackCount('in_queue') > $this->getConfigInstance()->getConfigEntry('cruncher_in_buffer_min_threshold'));
+ $isFilled = ($this->bufferInstance->getStackCount(self::STACKER_NAME_IN_QUEUE) > $this->getConfigInstance()->getConfigEntry('cruncher_in_buffer_min_threshold'));
// And return the result
return $isFilled;
* @param $version Version number of this cruncher
* @return void
*/
- public final function enableIsActive ($isActive = true) {
+ public final function enableIsActive ($isActive = TRUE) {
$this->isActive = (bool) $isActive;
}
$this->bufferInstance = ObjectFactory::createObjectByConfiguredName('cruncher_buffer_stacker_class');
// Initialize common stackers, like in/out
- $this->bufferInstance->initStacker('in_queue');
- $this->bufferInstance->initStacker('out_queue');
+ $this->bufferInstance->initStacks(array(
+ self::STACKER_NAME_IN_QUEUE,
+ self::STACKER_NAME_OUT_QUEUE
+ ));
// Output debug message
self::createDebugInstance(__CLASS__)->debugOutput('CRUNCHER: All buffers are now initialized.');