public static async Task <HttpResponseMessage> Run(
            [HttpTrigger(AuthorizationLevel.Function, "post", Route = null)] GridEvent <JObject>[] gridEvents,
            [Table(nameof(Collections.Events), Connection = AppSettingContainingConnectionString)] CloudTable eventsTable,
            [Inject(typeof(IStorageFactory <EventHistoryTableEntity>))] IStorageFactory <EventHistoryTableEntity> storageFactory,
            ILogger logger)
        {
            var eventProcessor = new EventHistoryProcessor(gridEvents, storageFactory.Create(eventsTable), logger);

            return(await ProcessorRunner.Run(eventProcessor));
        }
 public PostponedProcessingRunner(
     IDataApiClient dataApiClient,
     IEnumerable <IProcessor> processors,
     IDataProcessingServiceLogger dataProcessingServiceLogger)
     : base(nameof(PostponedProcessingRunner), DataApiClient.GetCollectionName <PostponedProcessingObject>())
 {
     this.dataApiClient = dataApiClient;
     this.dataProcessingServiceLogger = dataProcessingServiceLogger;
     this.processors = processors.ToDictionary(x => x.DisplayName, x => x);
     processorRunner = new ProcessorRunner(dataApiClient, dataProcessingServiceLogger);
 }
예제 #3
0
        public static async Task <HttpResponseMessage> Run(
            [HttpTrigger(AuthorizationLevel.Function, "post", Route = null)] GridEvent <StorageEvent>[] gridEvents,
            [Table(nameof(Collections.AccountsV1), Connection = AppSettingContainingConnectionString)] CloudTable accountsV1,
            [Table(nameof(Collections.UsersV1), Connection = AppSettingContainingConnectionString)] CloudTable UsersV1,
            [Table(nameof(Collections.ContactsV1), Connection = AppSettingContainingConnectionString)] CloudTable contactsV1,
            [Inject(typeof(IStorageFactory <StorageEventTableEntity>))] IStorageFactory <StorageEventTableEntity> storageFactory,
            ILogger logger)
        {
            var storageTables = new Dictionary <string, IStorage <StorageEventTableEntity> >
            {
                { Collections.AccountsV1, storageFactory.Create(accountsV1) },
                { Collections.UsersV1, storageFactory.Create(UsersV1) },
                { Collections.ContactsV1, storageFactory.Create(contactsV1) },
            };

            var eventProcessor = new StorageEventProcessor(gridEvents, storageTables, logger);

            return(await ProcessorRunner.Run(eventProcessor));
        }