/// <summary>
        /// Creates new instance of spooler and runs process delegate in separate tasks for all inputs
        /// </summary>
        /// <param name="stateManager"></param>
        /// <param name="inputs">list of inputs to run tasks for</param>
        /// <param name="process">process to run for all inputs</param>
        /// <param name="outputConverter">translator for save task results before saving output to stateManager</param>
        /// <returns>newly created spooler instance</returns>
        public static async Task <Spooler <TIn, TOut, TResult> > StartNewAsync(IStateManager stateManager, TIn[] inputs, Func <TIn, Task <TOut> > process, Converter <SpoolerResult <TIn, TOut>, TResult> outputConverter, int batchSize = 1)
        {
            var spooler = new Spooler <TIn, TOut, TResult>(stateManager, inputs, process, outputConverter, batchSize);
            await spooler.StartAsync();

            return(spooler);
        }
        public Spooler <TIn, TOut, TResult> CreateSpooler <TIn, TOut, TResult>(IStateManager stateManager, int batchSize)
        {
            var spooler = new Spooler <TIn, TOut, TResult>(stateManager, this, batchSize);

            return(spooler);
        }