Exemple #1
0
        /// <summary>
        /// Executes a request through it's generic types
        /// </summary>
        public override TResponse Execute(TArgument arg)
        {
            // Construct the function to be used
            var func = new TComputeFunc();

            // Broadcast the request to the compute pool and assemble a list of the results
            var Result = Compute?.Broadcast(func, arg);

            // Reduce the set of results to a single aggregated result and send the result back
            // If there is no task result then return a null response
            return(Result?.Count > 0 ? Result.Aggregate((first, second) => first.AggregateWith(second)) : null);
        }