Esempio n. 1
0
        public async Task <string> DoWithin5Seconds(int timeInMilliSeconds)
        {
            CancellationTokenSource source = new CancellationTokenSource();
            CancellationToken       token  = source.Token;

            source.CancelAfter(5000);
            _mediatorService.DelayedNotify(timeInMilliSeconds, token);
            var message = "Finished within 5 seconds.";

            _logger.LogInformation(message);

            return(message);
        }