Exemple #1
0
        public async Task ImportProduct(StockMarket stockMarket, CancellationToken cancellationToken)
        {
            var resourceBucketName = default(string);

            switch (stockMarket)
            {
            case StockMarket.Eurex:
                resourceBucketName = CumulusConstants.SystemBucketObject.EurexProducts;
                break;

            case StockMarket.Xetra:
                resourceBucketName = CumulusConstants.SystemBucketObject.XetraProducts;
                break;

            default: throw new ArgumentException("Invalid Stock Market");
            }

            var objectStream = await this.amazonS3.GetObjectStreamAsync(CumulusConstants.SystemBucket.Resource, resourceBucketName, null, cancellationToken);

            using (objectStream)
                await installService.InstallProductAsync(stockMarket, objectStream, cancellationToken);
        }