public static ILogsProcessorBuilder UseAzureTableStorageForBlockProgress( this ILogsProcessorBuilder processor, CloudTableSetup cloudTableSetup) { processor.BlockProgressRepository = cloudTableSetup.CreateBlockProgressRepository(); return(processor); }
public static ILogsProcessorBuilder StoreInAzureTable(this ILogsProcessorBuilder eventLogProcessor, CloudTableSetup cloudTableSetup, Predicate <FilterLog> predicate = null) { var transactionLogRepository = cloudTableSetup.CreateTransactionLogRepository(); var processor = new TransactionLogProcessor(transactionLogRepository, predicate); eventLogProcessor.Add(processor); return(eventLogProcessor); }
public static ILogsProcessorBuilder StoreInAzureTable <TEventDto>(this ILogsProcessorBuilder processorBuilder, CloudTableSetup cloudTableSetup, Predicate <EventLog <TEventDto> > predicate = null) where TEventDto : class, new() { var transactionLogRepository = cloudTableSetup.CreateTransactionLogRepository(); var processor = new TransactionLogProcessor <TEventDto>(transactionLogRepository, predicate); processorBuilder.Add(processor); return(processorBuilder); }
private static AzureSearchService CreateAzureSearchServiceAndMarkForDisposal(this ILogsProcessorBuilder processorBuilder, string searchServiceName, string apiKey) { var searchService = new AzureSearchService(searchServiceName, apiKey); processorBuilder.DisposeOnProcessorDisposing(searchService); return(searchService); }
public static async Task<ILogsProcessorBuilder> AddToQueueAsync( this ILogsProcessorBuilder eventLogProcessor, string azureConnectionString, string queueName, Predicate<FilterLog> predicate = null, Func<FilterLog, object> mapper = null) { var factory = new AzureSubscriberQueueFactory(azureConnectionString); return await eventLogProcessor.AddToQueueAsync(factory, queueName, predicate, mapper); }
public static ILogsProcessorBuilder AddToSearchIndex <TEventDto>( this ILogsProcessorBuilder processorBuilder, IEventIndexer <TEventDto> indexer, Predicate <EventLog <TEventDto> > predicate = null) where TEventDto : class, new() { var processor = new EventIndexProcessor <TEventDto>(indexer, predicate: predicate); processorBuilder.Add(processor); return(processorBuilder); }
public static async Task <ILogsProcessorBuilder> AddToSearchIndexAsync <TEventDto>( this ILogsProcessorBuilder processorBuilder, string searchServiceName, string apiKey, string indexName, Predicate <EventLog <TEventDto> > predicate = null) where TEventDto : class, new() { var searchService = processorBuilder.CreateAzureSearchServiceAndMarkForDisposal(searchServiceName, apiKey); return(await processorBuilder.AddToSearchIndexAsync(searchService, indexName : indexName, predicate : predicate).ConfigureAwait(false)); }
public static async Task <ILogsProcessorBuilder> AddToSearchIndexAsync <TEventDto>( this ILogsProcessorBuilder processorBuilder, IAzureSearchService azureSearchService, string indexName, Predicate <EventLog <TEventDto> > predicate = null) where TEventDto : class, new() { var indexer = await azureSearchService.CreateEventIndexer <TEventDto>(indexName).ConfigureAwait(false); processorBuilder.DisposeOnProcessorDisposing(indexer); return(processorBuilder.AddToSearchIndex(indexer, predicate: predicate)); }
public static async Task<ILogsProcessorBuilder> AddToQueueAsync( this ILogsProcessorBuilder eventLogProcessor, AzureSubscriberQueueFactory queueFactory, string queueName, Predicate<FilterLog> predicate = null, Func<FilterLog, object> mapper = null) { var queue = await queueFactory.GetOrCreateQueueAsync(queueName); eventLogProcessor.AddToQueue(queue, predicate, mapper); return eventLogProcessor; }
public static async Task<ILogsProcessorBuilder> AddToQueueAsync<TEventDto>( this ILogsProcessorBuilder eventLogProcessor, string azureConnectionString, string queueName, Predicate<EventLog<TEventDto>> predicate = null, Func<EventLog<TEventDto>, object> mapper = null) where TEventDto : class, new() { var factory = new AzureSubscriberQueueFactory(azureConnectionString); return await eventLogProcessor.AddToQueueAsync(factory, queueName, predicate, mapper); }
public static async Task <ILogsProcessorBuilder> AddToSearchIndexAsync <TEventDto, TSearchDocument>( this ILogsProcessorBuilder processorBuilder, string searchServiceName, string apiKey, Index azureIndex, Func <EventLog <TEventDto>, TSearchDocument> mappingFunc, Predicate <EventLog <TEventDto> > predicate = null) where TEventDto : class, new() where TSearchDocument : class, new() { var searchService = processorBuilder.CreateAzureSearchServiceAndMarkForDisposal(searchServiceName, apiKey); return(await processorBuilder.AddToSearchIndexAsync(searchService, azureIndex, mappingFunc, predicate).ConfigureAwait(false)); }
public static async Task <ILogsProcessorBuilder> AddToSearchIndexAsync <TEventDto, TSearchDocument>( this ILogsProcessorBuilder processorBuilder, IAzureSearchService azureSearchService, Index azureIndex, Func <EventLog <TEventDto>, TSearchDocument> mappingFunc, Predicate <EventLog <TEventDto> > predicate = null) where TEventDto : class, new() where TSearchDocument : class, new() { var indexer = await azureSearchService.CreateEventIndexer(azureIndex, mappingFunc).ConfigureAwait(false); processorBuilder.DisposeOnProcessorDisposing(indexer); return(processorBuilder.AddToSearchIndex(indexer, predicate)); }
public static async Task<ILogsProcessorBuilder> AddToQueueAsync<TEventDto>( this ILogsProcessorBuilder eventLogProcessor, AzureSubscriberQueueFactory queueFactory, string queueName, Predicate<EventLog<TEventDto>> predicate = null, Func<EventLog<TEventDto>, object> mapper = null) where TEventDto : class, new() { var queue = await queueFactory.GetOrCreateQueueAsync(queueName); eventLogProcessor.AddToQueue(queue, predicate, mapper); return eventLogProcessor; }
public WritingTransfersToTheAzureStorage(string azureConnectionString, string tablePrefix, uint numberOfBlocksToProcess, TimeSpan maxDuration, uint maxBlocksPerBatch) { cancellationTokenSource = new CancellationTokenSource(maxDuration); _builder = new LogsProcessorBuilder("https://rinkeby.infura.io/v3/7238211010344719ad14a89db874158c") .Filter <TransferEventDto>() .StoreInAzureTable(azureConnectionString, tablePrefix, (Predicate <EventLog <TransferEventDto> >)((tfr) => TransferCallback(tfr))) .OnBatchProcessed((args) => Output(args.LastRangeProcessed)) .SetBlocksPerBatch(maxBlocksPerBatch) .SetLog(_log.ToILog()); ethApiContractService = _builder.Eth; NumberOfBlocksToProcess = numberOfBlocksToProcess; }
public WritingTransfersToTheConsole(string url, ILog log, uint numberOfBlocksToProcess, TimeSpan maxDuration, uint maxBlocksPerBatch) { cancellationTokenSource = new CancellationTokenSource(maxDuration); _builder = new LogsProcessorBuilder <TransferEventDto>(url) .OnEvents((events) => Output(events)) .OnBatchProcessed((args) => { HandleBatchProcessed(args.LastRangeProcessed); }) .SetBlocksPerBatch(maxBlocksPerBatch) .SetLog(log); ethApiContractService = _builder.Eth; Log = log; NumberOfBlocksToProcess = numberOfBlocksToProcess; }
public static ILogsProcessorBuilder UseAzureTableStorageForBlockProgress( this ILogsProcessorBuilder processorBuilder, string azureConnectionString, string tableNamePrefix) { return(processorBuilder.UseAzureTableStorageForBlockProgress(new CloudTableSetup(azureConnectionString, tableNamePrefix))); }
public static ILogsProcessorBuilder StoreInAzureTable(this ILogsProcessorBuilder processorBuilder, string azureConnectionString, string tablePrefix, Predicate <FilterLog> predicate = null) => StoreInAzureTable(processorBuilder, new CloudTableSetup(azureConnectionString, tablePrefix), predicate);
public static ILogsProcessorBuilder StoreInAzureTable <TEventDto>(this ILogsProcessorBuilder processorBuilder, string azureConnectionString, string tablePrefix, Predicate <EventLog <TEventDto> > predicate = null) where TEventDto : class, new() => StoreInAzureTable <TEventDto>(processorBuilder, new CloudTableSetup(azureConnectionString, tablePrefix), predicate);