public function CapacityTrackerInterface::getIdealConditionsLimit in Purge 8.3
Get the maximum number of invalidations that can be processed.
External cache invalidation is expensive and can become exponentially more expensive when multiple platforms are being invalidated. To assure that we don't purge more than request lifetime allows for, ::getTimeHintTotal() gives the highest number of seconds a cache invalidation could take.
A call to ::getRemainingInvalidationsLimit() calculates how many cache invalidations are left to be processed during this request. It bases its decision on ::getMaxExecutionTime() and ::getIdealConditionsLimit() and information tracked during request lifetime. When it returns zero, no more items can be claimed from the queue or fed to the purgers service.
In order to track this global limit, ::decrementLimit() gets called every time the purgers service attempted one or more invalidations until the value becomes zero.
Return value
int The number of invalidations that can be processed under ideal conditions.
Throws
\Drupal\purge\Plugin\Purge\Purger\Exception\BadPluginBehaviorException Thrown when a returned value is not a integer or when it equals to 0.
See also
\Drupal\purge\Plugin\Purge\Purger\PurgerCapacityDataInterface::getIdealConditionsLimit()
1 method overrides CapacityTrackerInterface::getIdealConditionsLimit()
- CapacityTracker::getIdealConditionsLimit in src/
Plugin/ Purge/ Purger/ CapacityTracker.php - Get the maximum number of invalidations that can be processed.
File
- src/
Plugin/ Purge/ Purger/ CapacityTrackerInterface.php, line 81
Class
- CapacityTrackerInterface
- Describes the capacity tracker.
Namespace
Drupal\purge\Plugin\Purge\PurgerCode
public function getIdealConditionsLimit();