| | | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | | 2 | | // Licensed under the MIT License. See License.txt in the project root for license information. |
| | | 3 | | |
| | | 4 | | using System; |
| | | 5 | | using System.Threading; |
| | | 6 | | |
| | | 7 | | namespace Microsoft.Azure.Batch |
| | | 8 | | { |
| | | 9 | | /// <summary> |
| | | 10 | | /// Stores options that configure the operation of methods on Batch client parallel operations. |
| | | 11 | | /// </summary> |
| | | 12 | | public class BatchClientParallelOptions |
| | | 13 | | { |
| | | 14 | | private int _maxDegreeOfParallelism; |
| | | 15 | | |
| | | 16 | | /// <summary> |
| | | 17 | | /// Gets or sets the maximum number of concurrent tasks enabled by this <see cref="BatchClientParallelOptions"/> |
| | | 18 | | /// The default value is 1. |
| | | 19 | | /// </summary> |
| | | 20 | | public int MaxDegreeOfParallelism |
| | | 21 | | { |
| | 16 | 22 | | get { return this._maxDegreeOfParallelism; } |
| | | 23 | | set |
| | | 24 | | { |
| | 11 | 25 | | if (value > 0) |
| | | 26 | | { |
| | 11 | 27 | | this._maxDegreeOfParallelism = value; |
| | | 28 | | } |
| | | 29 | | else |
| | | 30 | | { |
| | 0 | 31 | | throw new ArgumentOutOfRangeException("value"); |
| | | 32 | | } |
| | | 33 | | } |
| | | 34 | | } |
| | | 35 | | |
| | | 36 | | /// <summary> |
| | | 37 | | /// Gets or sets the <see cref=" System.Threading.CancellationToken"/> associated with this <see cref="BatchClie |
| | | 38 | | /// The default is <see cref=" System.Threading.CancellationToken.None"/>. |
| | | 39 | | /// </summary> |
| | 0 | 40 | | public CancellationToken CancellationToken { get; set; } |
| | | 41 | | |
| | | 42 | | /// <summary> |
| | | 43 | | /// Initializes a new instance of the <see cref="BatchClientParallelOptions"/> class. |
| | | 44 | | /// </summary> |
| | 7 | 45 | | public BatchClientParallelOptions() |
| | | 46 | | { |
| | 7 | 47 | | this.MaxDegreeOfParallelism = 1; |
| | 7 | 48 | | } |
| | | 49 | | } |
| | | 50 | | } |