private static string GetKey(ArchiveEntry entry) { if (entry.Store != null) { return(entry.Store.Key); } if (entry.Remove != null) { return(entry.Remove.Key); } throw new InvalidOperationException(); }
private static ArchiveEntry CreateArchiveEntry(ICacheNotification notification) { var archiveEntry = new ArchiveEntry { Store = notification as StoreNotification, Clear = notification as ClearNotification, Remove = notification as RemoveNotification, Touch = notification as TouchNotification }; return(archiveEntry); }
private void OnNotification(int version, ArchiveEntry archiveEntry) { if (_lastVersion > version) { return; } if (!Full) { WriteSingleNotification(archiveEntry); _lastVersion = version; } else { CompactCache(); } }
private void WriteSingleNotification(ArchiveEntry archiveEntry) { Serializer.SerializeWithLengthPrefix(_outputStream, archiveEntry, PrefixStyle.Fixed32); _outputStream.FlushAsync(); }