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); }
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; }
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)); }
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)); }
public WarehouseActor(Func <long, Task <T> > externalLoaderFunc, ILogger log) { _externalLoaderFunc = externalLoaderFunc; _snapshots = new SuperBinaryRoot <Snapshot <T> >(log); }