Exemple #1
0
        public async Task On(for_WebhookScheduler.given.Payload payload)
        {
            var start = DateTimeOffset.UtcNow;
            await Task.Delay(10);

            _values.Add(payload.Number);
            var complete = DateTimeOffset.UtcNow;
        }
        public void On(for_WebhookScheduler.given.Payload payload)
        {
            var start = DateTimeOffset.UtcNow;

            _logger.Information($"{start.ToString()} {GetHashCode()} VOID about started to process {payload.Number}");
            Task.Delay(10).Wait();
            _values.Add(payload.Number);
            var complete = DateTimeOffset.UtcNow;

            _logger.Information($"{complete.ToString()} {GetHashCode()} VOID finished processing {payload.Number}. Took {(complete - start).TotalMilliseconds}");
        }
        public Task On(for_WebhookScheduler.given.Payload payload)
        {
            var start = DateTimeOffset.UtcNow;

            //_logger.Information($"{start.ToString()} {GetHashCode()} {nameof(error_throwing_number_payload_processor)} about started to process {payload.Number}");
            Task.Delay(10).Wait();
            if (payload.Number % 5 == 0)
            {
                //_logger.Error($"{DateTimeOffset.UtcNow.ToString()} {GetHashCode()} {nameof(error_throwing_number_payload_processor)} {payload.Number}");
                throw new ArgumentException("Cannot have a number divisible by 5");
            }

            _values.Add(payload.Number);
            return(Task.CompletedTask);
            //var complete = DateTimeOffset.UtcNow;
            //_logger.Information($"{complete.ToString()} {GetHashCode()} ERROR finished processing {payload.Number}. Took {(complete - start).TotalMilliseconds}");
        }