예제 #1
0
 public LibrarianActor(Guid factoryId, long factoryInstanceId, long versionNumber, Func <IAsyncBusBroker, IAsyncBusEntity> busEntityFunc, ILogger log)
 {
     FactoryId         = factoryId;
     FactoryInstanceId = factoryInstanceId;
     VersionNumber     = versionNumber;
     _busEntityFunc    = busEntityFunc;
     _log     = log;
     _updates = new SuperBinaryRoot <IDictionary <long, ICumulativeUpdate <T> > >(log);
 }
예제 #2
0
        internal VendorActor(Guid factoryId, long factoryInstanceId, LibrarianActor <T> librarian, Func <IAsyncBusBroker, IAsyncBusEntity> busEntityFunc, ILogger log)
        {
            _versionNumber          = librarian.VersionNumber;
            _confirmedVersionNumber = librarian.VersionNumber + 1;
            _librarian     = librarian;
            _busEntityFunc = busEntityFunc;
            _log           = log;
            _versions      = new SuperBinaryRoot <VersionAccumulator>(log);

            FactoryId         = factoryId;
            FactoryInstanceId = factoryInstanceId;
        }
예제 #3
0
 public static T Get <T>(this ISuperSonicCollection <T> collection, long index, T defaultValue = default(T)) where T : class
 {
     return(collection.AddOrUpdate(index, x => defaultValue, x => x));
 }
예제 #4
0
        public static T AddOrUpdate <T>(this ISuperSonicCollection <T> collection, long index, Func <long, T> createFunc, Func <T, T> updateFunc) where T : class
        {
            T old;

            return(collection.AddOrUpdate(index, createFunc, updateFunc, out old));
        }
예제 #5
0
 public WarehouseActor(Func <long, Task <T> > externalLoaderFunc, ILogger log)
 {
     _externalLoaderFunc = externalLoaderFunc;
     _snapshots          = new SuperBinaryRoot <Snapshot <T> >(log);
 }