예제 #1
0
        private async Task LogMetrics(string sourceLabel, long itemIndex, bool isCompleted, double rollingTiming)
        {
            if (itemIndex == -1 || isCompleted)
            {
                await StdOut.WriteLineAsync(string.Format("{0}@{4}-{5:N}: itemIndex = {1}, isCompleted = {2}, rollingTiming = {3}", sourceLabel, itemIndex, isCompleted, rollingTiming, Environment.CurrentManagedThreadId, this.ComponentId));
            }

            if (isCompleted && itemIndex == 0)
            {
                throw new InvalidOperationException();
            }
        }
예제 #2
0
        private async Task DisposeAsync()
        {
            await StdOut.WriteLineAsync(string.Format("{0}::{1}", nameof(AsyncDisposal), nameof(this.DisposeAsync)));

            await this.Disposable.DisposeAsync(this.CancellationToken);
        }