SessionGarbageCollectionPolicy
final class SessionGarbageCollectionPolicy (View source)
Defines the canonical probability for request-driven session garbage collection.
Constants
| DEFAULT_PROBABILITY |
Gives the standard 100-entry file/database batches capacity for two candidates per request. |
| DEFAULT_DIVISOR |
|
Methods
Defines how many outcomes trigger collection within the positive outcome range.
Returns the number of outcomes that trigger collection.
Returns the total number of possible collection outcomes.
Selects whether the current request should perform opportunistic collection.
Details
__construct
__construct(int $probability = self::DEFAULT_PROBABILITY, int $divisor = self::DEFAULT_DIVISOR)
Defines how many outcomes trigger collection within the positive outcome range.
probability
int
probability()
Returns the number of outcomes that trigger collection.
divisor
int
divisor()
Returns the total number of possible collection outcomes.
shouldRun
bool
shouldRun()
Selects whether the current request should perform opportunistic collection.