Ejemplo n.º 1
0
        /// <summary>
        /// Occurs when the strategy is starting to execute.
        /// </summary>
        /// <param name="context">The contextual information about the item produced.</param>
        protected virtual void OnStarted(IProducerConsumerContext <TItem> context)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            context.ConsumptionContext.ExecutionStrategy = this;
            ProcessingContext.SetCurrent(context);
        }