Inheritance diagram for QueuedCache:
Public Member Functions | |
this (uint capacity, uint concurrency=16) | |
IPayload | get (char[] key) |
IPayload | put (char[] key, IPayload item) |
IPayload | extract (char[] key, ulong timeLimit=ulong.max) |
QueuedEntry | createQueuedEntry (char[] key, IPayload entry) |
Private Member Functions | |
final QueuedEntry | deReference (QueuedEntry entry) |
final QueuedEntry | reReference (QueuedEntry entry) |
final QueuedEntry | addEntry (char[] key, IPayload item) |
IPayload | extract (char[] key) |
ICache | bind (ICacheLoader loader) |
Private Attributes | |
QueuedEntry | head |
QueuedEntry | tail |
int | entries |
int | capacity |
This is great for keeping commonly accessed items around, while limiting the amount of memory used. Typically, the queue size would be set in the hundreds (perhaps thousands).
Definition at line 59 of file QueuedCache.d.
|
Construct a cache with the specified maximum number of entries. Additions to the cache beyond this number will reuse the slot of the least-recently-referenced cache entry. The concurrency level indicates approximately how many threads will content for write access at one time. Reimplemented from PlainCache. Definition at line 79 of file QueuedCache.d. References capacity. |
|
Get the cache entry identified by the given key Reimplemented from PlainCache. Reimplemented in VirtualCache. Definition at line 91 of file QueuedCache.d. Referenced by ChannelCache::get(), ChannelCache::lockWhereInvalid(), ServletProvider::service(), and testQueuedCache(). |
|
Place an entry into the cache and associate it with the provided key. Note that there can be only one entry for any particular key. If two entries are added with the same key, the second effectively overwrites the first. Returns what it was given Reimplemented from PlainCache. Reimplemented in VirtualCache. Definition at line 114 of file QueuedCache.d. Referenced by testQueuedCache(). |
|
Remove (and return) the cache entry associated with the provided key. Returns null if there is no such entry. Reimplemented from PlainCache. Reimplemented in VirtualCache. Definition at line 142 of file QueuedCache.d. Referenced by ChannelCache::extract(). |
|
Overridable factory for creating list entries. Definition at line 167 of file QueuedCache.d. |
|
Place a cache entry at the tail of the queue. This makes it the least-recently referenced. Definition at line 181 of file QueuedCache.d. |
|
Move a cache entry to the head of the queue. This makes it the most-recently referenced. Definition at line 203 of file QueuedCache.d. |
|
Add an entry into the queue. If the queue is full, the least-recently-referenced entry is reused for the new addition. Definition at line 226 of file QueuedCache.d. |
|
Remove (and return) the cache entry associated with the provided key. Returns null if there is no such entry. Definition at line 105 of file PlainCache.d. References HashMap::remove(). Referenced by testPlainCache(). |
|
This is a factory for producing an ICache instance upon the cache content. The provided loader will populate the cache whenever a stale or missing entry is seen Reimplemented from IMutableCache. Definition at line 137 of file PlainCache.d. References PlainCache::get(), IPayload::getTime(), ICacheLoader::load(), and ICacheLoader::test(). |
|
Definition at line 62 of file QueuedCache.d. |
|
Definition at line 62 of file QueuedCache.d. |
|
Definition at line 66 of file QueuedCache.d. |
|
Definition at line 66 of file QueuedCache.d. Referenced by this(). |