|start | index | login or register | find | edit|
Online for 6938 days.
6 active users:
by unknown, a long time ago
void Init(IStore prev);
When the CacheStore is initialised, it calls the FileStore's Init(IStore prev) method. The FileStore then deserialises all the objects it has stored in previous sessions, and plays them back into the cache (that is it calls prev.Add(obj). This means that the cache is now fully populated.
A CacheStore.Get will either return an object if it is in the cache, or delegate to the next IStore, in this case a FileStore, which returns null.
On Add, the CacheStore just adds the object to its local cache. But when Flush() is called it calls Add on the FileStore for each object it has cached, and all state is serialized to the file.
No attachments for this snip.
Upload / manage attachments!
|c'est un vanilla site|