/// <summary> /// Creates a new instance with the specified settings. /// </summary> /// <param name="elementCountThreshold">The element count above which further processing of a batch will occur.</param> /// <param name="byteCountThreshold">The byte count above which further processing of a batch will occur.</param> /// <param name="delayThreshold">The batch lifetime above which further processing of a batch will occur.</param> public BatchingSettings(long?elementCountThreshold, long?byteCountThreshold, TimeSpan?delayThreshold) { ElementCountThreshold = GaxPreconditions.CheckNonNegative(elementCountThreshold, nameof(elementCountThreshold)); ByteCountThreshold = GaxPreconditions.CheckNonNegative(byteCountThreshold, nameof(byteCountThreshold)); GaxPreconditions.CheckNonNegative(delayThreshold?.TotalSeconds, nameof(delayThreshold)); DelayThreshold = delayThreshold; }
/// <summary> /// TODO /// </summary> /// <param name="maxOutstandingElementCount"></param> /// <param name="maxOutstandardByteCount"></param> public FlowControlSettings(long?maxOutstandingElementCount, long?maxOutstandardByteCount) { MaxOutstandingElementCount = GaxPreconditions.CheckNonNegative(maxOutstandingElementCount, nameof(maxOutstandingElementCount)); MaxOutstandingByteCount = GaxPreconditions.CheckNonNegative(maxOutstandardByteCount, nameof(maxOutstandardByteCount)); }