public override async Task OnActivateAsync() { await base.OnActivateAsync(); ConcurrentChannel = ServiceProvider.GetService <IMpscChannel <ConcurrentTransport <Snapshot <PrimaryKey, SnapshotType> > > >(); ConcurrentChannel.BindConsumer(ConcurrentExecuter); }
public override async Task OnActivateAsync() { await base.OnActivateAsync(); ConcurrentChannel = ServiceProvider.GetService <IMpscChannel <ConcurrentTransport <Snapshot <PrimaryKey, SnapshotType> > > >(); ConcurrentChannel.BindConsumer(BatchInputProcessing).ActiveConsumer(); }
public EventStorage(IServiceProvider serviceProvider, StorageConfig grainConfig) { serializer = serviceProvider.GetService <ISerializer>(); logger = serviceProvider.GetService <ILogger <EventStorage <PrimaryKey> > >(); mpscChannel = serviceProvider.GetService <IMpscChannel <DataAsyncWrapper <SaveTransport <PrimaryKey>, bool> > >(); mpscChannel.BindConsumer(BatchProcessing).ActiveConsumer(); this.grainConfig = grainConfig; }
public EventStorage(IServiceProvider serviceProvider, StorageOptions grainConfig) { serializer = serviceProvider.GetService <ISerializer>(); logger = serviceProvider.GetService <ILogger <EventStorage <PrimaryKey> > >(); mpscChannel = serviceProvider.GetService <IMpscChannel <AsyncInputEvent <BatchAppendTransport <PrimaryKey>, bool> > >(); mpscChannel.BindConsumer(BatchProcessing); this.grainConfig = grainConfig; }
public EventStorage(IServiceProvider serviceProvider, StorageOptions config) { logger = serviceProvider.GetService <ILogger <EventStorage <PrimaryKey> > >(); serializer = serviceProvider.GetService <ISerializer>(); mpscChannel = serviceProvider.GetService <IMpscChannel <AsyncInputEvent <BatchAppendTransport <PrimaryKey>, bool> > >(); mpscChannel.BindConsumer(BatchInsertExecuter); this.config = config; }
public TransactionStorage( IServiceProvider serviceProvider, IOptions <TransactionStorageConfig> storageConfig, IOptions <SqlConfig> sqlConfig) { connection = sqlConfig.Value.ConnectionDict[storageConfig.Value.ConnectionKey]; mpscChannel = serviceProvider.GetService <IMpscChannel <DataAsyncWrapper <AppendInput, bool> > >(); serializer = serviceProvider.GetService <ISerializer>(); mpscChannel.BindConsumer(BatchProcessing); mpscChannel.ActiveConsumer(); }
public DistributedTxStorage( IServiceProvider serviceProvider, IOptions <TransactionOptions> options, IOptions <SQLServerConnections> connectionsOptions) { this.options = options; connection = connectionsOptions.Value.ConnectionDict[options.Value.ConnectionKey]; CreateEventSubRecordTable(); mpscChannel = serviceProvider.GetService <IMpscChannel <AsyncInputEvent <AppendInput, bool> > >(); serializer = serviceProvider.GetService <ISerializer>(); mpscChannel.BindConsumer(BatchProcessing); }
public TransactionStorage( IServiceProvider serviceProvider, IOptions <TransactionOptions> transactionOptions, IOptions <MongoConnections> connectionsOptions) { this.transactionOptions = transactionOptions; client = ClientFactory.CreateClient(connectionsOptions.Value.ConnectionDict[transactionOptions.Value.ConnectionKey]); mpscChannel = serviceProvider.GetService <IMpscChannel <AsyncInputEvent <AppendInput, bool> > >(); serializer = serviceProvider.GetService <ISerializer>(); serviceProvider.GetService <IIndexBuildService>().CreateTransactionStorageIndex(client, transactionOptions.Value.Database, transactionOptions.Value.CollectionName).GetAwaiter().GetResult(); mpscChannel.BindConsumer(BatchProcessing); }
public ConsumerRunner( IRabbitMQClient client, IServiceProvider provider, RabbitConsumer consumer, QueueInfo queue) { Client = client; Logger = provider.GetService <ILogger <ConsumerRunner> >(); mpscChannel = provider.GetService <IMpscChannel <BasicDeliverEventArgs> >(); mpscChannel.BindConsumer(BatchExecuter); Consumer = consumer; Queue = queue; }
public DistributedTxStorage( IServiceProvider serviceProvider, IOptions <TransactionOptions> options, IOptions <SQLServerConnections> connectionsOptions) { this.options = options; connection = connectionsOptions.Value.ConnectionDict[options.Value.ConnectionKey]; CreateEventSubRecordTable(); mpscChannel = serviceProvider.GetService <IMpscChannel <AsyncInputEvent <AppendInput, bool> > >(); serializer = serviceProvider.GetService <ISerializer>(); mpscChannel.BindConsumer(BatchInsertExecuter); delete_sql = $"delete from {options.Value.TableName} WHERE UnitName=@UnitName and TransactionId=@TransactionId"; select_list_sql = $"select * from {options.Value.TableName} WHERE UnitName=@UnitName"; update_sql = $"update {options.Value.TableName} set Status=@Status where UnitName=@UnitName and TransactionId=@TransactionId"; insert_sql = $"INSERT INTO {options.Value.TableName}(UnitName,TransactionId,Data,Status) VALUES(@UnitName,@TransactionId,@Data,@Status)"; }