public TrainBag(ushort trainId, IBucketFactory bucketFactory, IMetaStorage metaStorage, BagSettings bagSettings) { TrainId = trainId; this.bucketFactory = bucketFactory; this.metaStorage = metaStorage; this.bagSettings = bagSettings; }
public Bag(ushort trainId, BagInfo bagInfo, IMetaStorage metaStorage, IBucketFactory bucketFactory) { this.trainId = trainId; BagInfo = bagInfo; this.metaStorage = metaStorage; this.bucketFactory = bucketFactory; if (bagInfo.BagSettings.PerBucketMessages > (2 << 16)) { throw new ArgumentException("PerBucketMessages must be < 2^16"); } }
public Server(Settings settings, IMetaStorage metaStorage, IBucketFactory bucketFactory, IIndexStore <long, ulong> piStore) { this.piStore = piStore; trainBags = new LogBins.TrainBag[settings.TrainsCount]; trainBagsSemaphores = new SemaphoreSlim[settings.TrainsCount]; for (int i = 0; i < trainBags.Length; ++i) { trainBags[i] = new LogBins.TrainBag((ushort)(i + 1), bucketFactory, metaStorage, new LogBins.BagSettings { PerBucketMessages = 8192 }); trainBagsSemaphores[i] = new SemaphoreSlim(1, 1); } piStore.Load(primaryIndex); }
/// <summary> /// Creates a new Instance of RestClient. /// </summary> /// <param name="token">The Token of the Bot.</param> /// <param name="factory">Factory which creates IBucket to use</param> public RestClient(string token, IBucketFactory factory) : this(token) => BucketFactory = factory;