Example #1
0
 public LogIndex(LogStore store, string name, Func<NeithLog, string> getKeyFunc)
 {
     Name = name;
     GetKeyFunc = getKeyFunc;
     IndexDir = store.DataDir.PathCombine("index", name).GetFullPath();
     Index = new PersistentDictionary<string, IndexValue>(IndexDir);
 }
Example #2
0
 public static IEnumerable<NeithLog> WhereKey(
     this LogIndex index,
     string key,LogStore store)
 {
     return index.Index
         .Where(a => a.Key.StartsWith(key))
         .Select(a => a.Value.ToLog(store));
 }
Example #3
0
 public static NeithLog ToLog(this LogIndex.IndexValue value, LogStore store)
 {
     return store.Dic[value.UtcTime];
 }
Example #4
0
 private void InitStoreTask()
 {
     // ログの保存処理
     store = LogStore.Instance;
     storeTask = Observable
         .FromEventPattern<NeithLogEventArgs>(this, "Receive")
         .SubscribeOn(Scheduler.ThreadPool)
         .Subscribe(a => Store.Store(a.EventArgs.Log));
 }