Пример #1
0
 public static void ForEachSnapshotComponent(ISnapshotHandler snapshotHandler)
 {
     foreach (var component in ComponentDatabase.IdsToDynamicInvokers.Values)
     {
         component.InvokeSnapshotHandler(snapshotHandler);
     }
 }
Пример #2
0
        internal static void ForSnapshotComponent(uint componentId, ISnapshotHandler handler)
        {
            if (!ComponentDatabase.IdsToDynamicInvokers.TryGetValue(componentId, out var component))
            {
                throw new ArgumentException($"Unknown component ID {componentId}.");
            }

            component.InvokeSnapshotHandler(handler);
        }
        public VolatileLogicalTimeManager(ISnapshotHandler handler, TimeSpan snapshotInterval)
        {
            this.lastSnapshot = TimeSpan.Zero;
            this.stopwatch    = new Stopwatch();
            this.isRunning    = false;
            this.rwLock       = new RwLock();

            this.handler          = handler;
            this.snapshotInterval = snapshotInterval;
            this.timer            = new Timer(o => this.TimerCallback());

            this.stopwatch.Start();
        }
 public VolatileLogicalTimeManager(ISnapshotHandler handler)
     : this(handler, TimeSpan.FromSeconds(DefaultLogicalTimeSnapshotIntervalInSeconds))
 {
 }
Пример #5
0
 public void Register(ISnapshotHandler snapshotHandler, string fileName)
 {
     _snapshotHandlersByFileName[fileName] = snapshotHandler;
 }
Пример #6
0
 public AccountDb(IGrainFactory grainFactory, ISnapshotHandler <long, AccountSnapshot> snapshotHandler)
 {
     this.grainFactory           = grainFactory;
     this.accountSnapshotHandler = snapshotHandler as AccountSnapshotHandler;
 }