Represents collection of events within a single physical file. It can be opened as mutable or as read-only
Inheritance: IDisposable
Exemple #1
0
        public static FileEventStore OpenForReading(string root, EventStoreId storeId)
        {
            var folder = Path.Combine(root, storeId.Name);
            var check  = FileEventPointer.OpenOrCreateForReading(Path.Combine(folder, "stream.chk"));
            var store  = FileEventStoreChunk.OpenForReading(Path.Combine(folder, "stream.dat"));

            return(new FileEventStore(storeId, store, check));
        }
Exemple #2
0
        public static FileEventStore CreateNew(string root, EventStoreId storeId)
        {
            var folder = Path.Combine(root, storeId.Name);

            if (!Directory.Exists(folder))
            {
                Directory.CreateDirectory(folder);
            }

            var check = FileEventPointer.OpenOrCreateForWriting((Path.Combine(folder, "stream.chk")));
            var store = FileEventStoreChunk.CreateNew(Path.Combine(folder, "stream.dat"));

            return(new FileEventStore(storeId, store, check));
        }
Exemple #3
0
 public FileEventStore(EventStoreId storeId, FileEventStoreChunk store, FileEventPointer checkpoint)
 {
     StoreId     = storeId;
     _store      = store;
     _checkpoint = checkpoint;
 }
 public FileEventStore(EventStoreId storeId, FileEventStoreChunk store, FileEventPointer checkpoint)
 {
     StoreId = storeId;
     _store = store;
     _checkpoint = checkpoint;
 }