gives you the advantage to add a buffer before reaching the limit to easy up reacting when limit is reached
helps you to set the limit in bytes, kilo bytes, mega bytes or giga bytes (same for the buffer)
comes with DependentInterface and AwareInterface
How can i use it?
$manager = new Net\Bazzline\Component\MemoryLimitManager\MemoryLimitManager();
$manager->setBufferInMegaBytes(4);
$manager->setLimitInMegaBytes(64);
while (!empty($dataSet)) {
if ($manager->isLimitReached()) {
//exit while loop, shutdown process
} else {
$data = array_shift($dataSet);
//work on data set
}
}
How can i install it?
Manuel
mkdir -p vendor/netbazzline/phpcomponentmemorylimitmanager
cd vendor/netbazzline/phpcomponentmemorylimitmanager
git clone https://github.com/bazzline/phpcomponentmemorylimitmanager
gives you the advantage to add a buffer before reaching the limit to easy up reacting when limit is reached
helps you to set the limit in seconds, minutes or hours (same for the buffer)
comes with DependentInterface and AwareInterface
How can i use it?
$manager = new Net\Bazzline\Component\TimeLimitManager\TimeLimitManager();
$manager->setBufferInSeconds(1);
$manager->setLimitInSeconds(4);
while (!empty($dataSet)) {
if ($manager->isLimitReached()) {
//exit while loop, shutdown process
} else {
$data = arrayshift($dataSet);
//work on data set
}
}
How can i install it?
Manuel
mkdir -p vendor/netbazzline/phpcomponenttimelimitmanager
cd vendor/netbazzline/phpcomponenttimelimitmanager
git clone https://github.com/bazzline/phpcomponenttimelimitmanager