public MongoDbSchedulerStoreFixture() { InstantSerializer.Register(); var mongoClient = new MongoClient("mongodb://localhost"); var mongoDatabase = mongoClient.GetDatabase("Testing"); Store = new MongoDbSchedulerStore <int>(mongoDatabase, new SchedulerOptions { QueueName = "Numbers" }); Store.InitializeAsync(default).Wait();
public MongoDbScheduler(MongoDbSchedulerStore <T> schedulerStore, SchedulerOptions schedulerOptions, IClock clock, ISemanticLog log) { this.schedulerStore = schedulerStore; this.schedulerOptions = schedulerOptions; actionBlock = new ActionBlock <MongoDbSchedulerDocument <T> >(HandleAsync, new ExecutionDataflowBlockOptions { BoundedCapacity = schedulerOptions.MaxParallelism * 4, MaxDegreeOfParallelism = schedulerOptions.MaxParallelism, MaxMessagesPerTask = 1 }); this.clock = clock; this.log = log; }