/// <summary>
        /// Adds an update to this transaction.
        /// </summary>
        /// <param name="stage">The stage to update.</param>
        /// <param name="update">The update action.</param>
        /// <returns>This transaction.</returns>
        public IPipelineTransaction Update(IPipelineStage stage, PipelineUpdateAction update)
        {
            if (stage is null)
            {
                throw new System.ArgumentNullException(nameof(stage));
            }
            if (update is null)
            {
                throw new System.ArgumentNullException(nameof(update));
            }

            PendingStages[stage] = new DeferredTransactionPart(stage, update, Timestamp++);

            return(this);
        }
Пример #2
0
        /// <summary>
        /// Adds the specified stage and update action as a part of the transaction.
        /// </summary>
        /// <param name="stage">The stage.</param>
        /// <param name="update">The update to perform.</param>
        /// <returns>This transaction.</returns>
        public IPipelineTransaction Update(IPipelineStage stage, PipelineUpdateAction update)
        {
            if (stage is null)
            {
                throw new ArgumentNullException(nameof(stage));
            }
            if (update is null)
            {
                throw new ArgumentNullException(nameof(update));
            }

            AssertNotCommitted();
            Parts.Add(new DeferredTransactionPart(stage, update, Control.GetTimestamp()));

            return(this);
        }
Пример #3
0
 /// <summary>
 /// Creates a new <see cref="DeferredTransactionPart"/>.
 /// </summary>
 /// <param name="stage">The stage which is updated.</param>
 /// <param name="action">The action which performs the update.</param>
 /// <param name="timestamp">The timestamp.</param>
 public DeferredTransactionPart(IPipelineStage stage, PipelineUpdateAction action, long timestamp)
 {
     Stage     = stage ?? throw new ArgumentNullException(nameof(stage));
     Action    = action ?? throw new ArgumentNullException(nameof(action));
     Timestamp = timestamp;
 }