|
Moodle
2.2.1
http://www.collinsharper.com
|
Public Member Functions | |
| eaccelerator () | |
| status () | |
| set ($key, $value, $ttl=0) | |
| get ($key) | |
| delete ($key) | |
| getforfill ($key) | |
| releaseforfill ($key) | |
Definition at line 46 of file eaccelerator.class.php.
| delete | ( | $ | key | ) |
| string | $key |
Definition at line 119 of file eaccelerator.class.php.
| eaccelerator | ( | ) |
object
Definition at line 53 of file eaccelerator.class.php.

| get | ( | $ | key | ) |
| string | $key |
Definition at line 104 of file eaccelerator.class.php.
| getforfill | ( | $ | key | ) |
In the simple case, this function will get the cached value if available. If the entry is not cached, it will try to get an exclusive lock that announces that this process will populate the cache.
If we fail to get the lock -- this means another process is doing it. so we wait (block) for a few microseconds while we wait for the cache to be filled or the lock to timeout.
If you get a false from this call, you _must_ populate the cache ASAP or indicate that you won't by calling releaseforfill().
This technique forces serialisation and so helps deal with thundering herd scenarios where a lot of clients ask the for the same idempotent (and costly) operation. The implementation is based on suggestions in this message http://marc.theaimsgroup.com/?l=git&m=116562052506776&w=2
| $key | string |
Definition at line 149 of file eaccelerator.class.php.
| releaseforfill | ( | $ | key | ) |
Release the exclusive lock obtained by getforfill(). See getforfill() for more details.
| $key | string |
Definition at line 183 of file eaccelerator.class.php.
| set | ( | $ | key, |
| $ | value, | ||
| $ | ttl = 0 |
||
| ) |
| string | $key | |
| string | $value | |
| int | $ttl |
Definition at line 87 of file eaccelerator.class.php.
| status | ( | ) |
The status of the eaccelerator, if it has been established this will return true
Definition at line 72 of file eaccelerator.class.php.