Beispiel #1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="grid">Grid.</param>
        /// <param name="compute">Compute.</param>
        /// <param name="task">Task.</param>
        /// <param name="arg">Argument.</param>
        public ComputeTaskHolder(Ignite grid, ComputeImpl compute, IComputeTask <TA, T, TR> task, TA arg)
        {
            _compute = compute;
            _arg     = arg;
            _task    = task;

            ResourceTypeDescriptor resDesc = ResourceProcessor.Descriptor(task.GetType());

            IComputeResourceInjector injector = task as IComputeResourceInjector;

            if (injector != null)
            {
                injector.Inject(grid);
            }
            else
            {
                resDesc.InjectIgnite(task, grid);
            }

            _resCache = !resDesc.TaskNoResultCache;
        }
Beispiel #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Compute"/> class.
        /// </summary>
        /// <param name="computeImpl">The compute implementation.</param>
        public Compute(ComputeImpl computeImpl)
        {
            Debug.Assert(computeImpl != null);

            _compute = computeImpl;
        }
Beispiel #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ComputeAsync"/> class.
 /// </summary>
 /// <param name="computeImpl">The compute implementation.</param>
 internal ComputeAsync(ComputeImpl computeImpl)
 {
     Compute = computeImpl;
 }