/// <summary>
        /// Invokes the specified method and then pumps any tasks in the queue.
        /// </summary>
        /// <param name="action"></param>
        /// <returns></returns>
        async Task InvokeAndPump(Func <Task> action)
        {
            Contract.Requires <ArgumentNullException>(action != null);

            var t = action();
            await pump.PumpAsync();

            await t;
        }
        /// <summary>
        /// Invokes the specified method and then pumps any tasks in the queue.
        /// </summary>
        /// <param name="action"></param>
        /// <returns></returns>
        async Task InvokeAndPump(Func <Task> action)
        {
            if (action == null)
            {
                throw new ArgumentNullException(nameof(action));
            }

            var t = action();
            await pump.PumpAsync();

            await t;
        }