CSharpAnalytics.Network.BackgroundHttpRequester.StopAsync C# (CSharp) Method

StopAsync() public method

Stop the BackgroundHttpRequester and return a list of URIs that were not requested.
public StopAsync ( ) : Task>
return Task>
        public async Task<List<Uri>> StopAsync()
        {
            if (!IsStarted)
                throw new InvalidOperationException(String.Format("Cannot stop a {0} when already stopped", GetType().Name));

            cancellationTokenSource.Cancel();
            await backgroundSender;

            return priorRequests
                .Concat(new[] { currentlySending })
                .Concat(currentRequests)
                .Where(r => r != null)
                .ToList();
        }