예제 #1
0
        /// <summary>
        /// Executes a request through it's generic types
        /// </summary>
        /// <param name="arg"></param>
        /// <param name="key">The spatial affinity key to be used to direct this request to the node owning the partition it maps to</param>
        /// <returns></returns>
        public virtual TResponse Execute(TArgument arg, ISubGridSpatialAffinityKey key)
        {
            if (key == null)
            {
                throw new TRexException("Affinity based result execution requires an affinity key");
            }

            // Construct the function to be used
            var func = new TComputeFunc
            {
                Argument = arg
            };

            // Send the result to the affinity bound node compute pool
            return(Compute?.AffinityCall(TRexCaches.SpatialSubGridDirectoryCacheName(StorageMutability.Immutable), key, func));
        }