You are here

public function PurgerBase::getIdealConditionsLimit in Purge 8.3

Get the maximum number of invalidations that this purger can process.

When Drupal requests are served through a webserver, several resource limitations - such as maximum execution time - affect how much objects are given to your purger plugin. However, under certain conditions - such as when ran through the command line - these limitations aren't in place. This is the 'ideal conditions' scenario under which your purger can operate.

However, we cannot feed the entire queue at once and therefore there will always be a hard outer limit of how many invalidation objects are being processed during Drupal's request lifetime.

Return value

int The number of invalidations you can process under ideal conditions.

Overrides PurgerCapacityDataInterface::getIdealConditionsLimit

See also

\Drupal\purge\Plugin\Purge\Purger\CapacityTrackerInterface::getRemainingInvalidationsLimit()

1 method overrides PurgerBase::getIdealConditionsLimit()
NullPurgerBase::getIdealConditionsLimit in tests/modules/purge_purger_test/src/Plugin/Purge/Purger/NullPurgerBase.php
Get the maximum number of invalidations that this purger can process.

File

src/Plugin/Purge/Purger/PurgerBase.php, line 81

Class

PurgerBase
Provides a base class for all purgers - the cache invalidation executors.

Namespace

Drupal\purge\Plugin\Purge\Purger

Code

public function getIdealConditionsLimit() {

  // We don't know how much invalidations our derivatives can process under
  // ideal circumstances, it can range from low numbers on inefficient CDNs to
  // literally thousands when connecting to efficient systems over a local
  // socket. Purger implementations are definitely encouraged to overload this
  // method with a value that is as accurately approached as possible.
  return 100;
}