-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy pathBlockingCollection`1.xml
More file actions
2877 lines (2748 loc) · 198 KB
/
Copy pathBlockingCollection`1.xml
File metadata and controls
2877 lines (2748 loc) · 198 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<Type Name="BlockingCollection<T>" FullName="System.Collections.Concurrent.BlockingCollection<T>">
<TypeSignature Language="C#" Value="public class BlockingCollection<T> : IDisposable, System.Collections.Generic.IEnumerable<T>, System.Collections.Generic.IReadOnlyCollection<T>, System.Collections.ICollection" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit BlockingCollection`1<T> extends System.Object implements class System.Collections.Generic.IEnumerable`1<!T>, class System.Collections.Generic.IReadOnlyCollection`1<!T>, class System.Collections.ICollection, class System.Collections.IEnumerable, class System.IDisposable" />
<TypeSignature Language="DocId" Value="T:System.Collections.Concurrent.BlockingCollection`1" />
<TypeSignature Language="VB.NET" Value="Public Class BlockingCollection(Of T)
Implements ICollection, IDisposable, IEnumerable(Of T), IReadOnlyCollection(Of T)" />
<TypeSignature Language="F#" Value="type BlockingCollection<'T> = class
 interface seq<'T>
 interface IEnumerable
 interface IReadOnlyCollection<'T>
 interface ICollection
 interface IDisposable" />
<TypeSignature Language="C++ CLI" Value="generic <typename T>
public ref class BlockingCollection : IDisposable, System::Collections::Generic::IEnumerable<T>, System::Collections::Generic::IReadOnlyCollection<T>, System::Collections::ICollection" />
<AssemblyInfo>
<AssemblyName>System.Collections.Concurrent</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.14.0</AssemblyVersion>
<AssemblyVersion>4.0.15.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<TypeForwardingChain>
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Collections.Concurrent" ToVersion="10.0.0.0" FrameworkAlternate="net-10.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Collections.Concurrent" ToVersion="11.0.0.0" FrameworkAlternate="net-11.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Collections.Concurrent" ToVersion="5.0.0.0" FrameworkAlternate="net-5.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Collections.Concurrent" ToVersion="6.0.0.0" FrameworkAlternate="net-6.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Collections.Concurrent" ToVersion="7.0.0.0" FrameworkAlternate="net-7.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Collections.Concurrent" ToVersion="8.0.0.0" FrameworkAlternate="net-8.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Collections.Concurrent" ToVersion="9.0.0.0" FrameworkAlternate="net-9.0" />
</TypeForwardingChain>
<TypeParameters>
<TypeParameter Name="T">
<Attributes>
<Attribute FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(2)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(2)>]</AttributeName>
</Attribute>
</Attributes>
</TypeParameter>
</TypeParameters>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>System.Collections.Generic.IEnumerable<T></InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.Collections.Generic.IReadOnlyCollection<T></InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.Collections.ICollection</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.Collections.IEnumerable</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.IDisposable</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<Attribute FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(0)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(0)>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="net-10.0;net-11.0;net-6.0;net-7.0;net-8.0;net-9.0">
<AttributeName Language="C#">[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]</AttributeName>
</Attribute>
</Attributes>
<Docs>
<typeparam name="T">The type of elements in the collection.</typeparam>
<summary>Provides blocking and bounding capabilities for thread-safe collections that implement <see cref="T:System.Collections.Concurrent.IProducerConsumerCollection`1" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
<xref:System.Collections.Concurrent.BlockingCollection`1> is a thread-safe collection class that provides the following:
- An implementation of the producer/consumer pattern; <xref:System.Collections.Concurrent.BlockingCollection`1> is a wrapper for the <xref:System.Collections.Concurrent.IProducerConsumerCollection`1> interface.
- Concurrent addition and removal of items from multiple threads with the <xref:System.Collections.Concurrent.BlockingCollection`1.Add*> and <xref:System.Collections.Concurrent.BlockingCollection`1.Take*> methods.
- A bounded collection that blocks <xref:System.Collections.Concurrent.BlockingCollection`1.Add*> and <xref:System.Collections.Concurrent.BlockingCollection`1.Take*> operations when the collection is full or empty.
- Cancellation of <xref:System.Collections.Concurrent.BlockingCollection`1.Add*> or <xref:System.Collections.Concurrent.BlockingCollection`1.Take*> operations by using a <xref:System.Threading.CancellationToken> object in the <xref:System.Collections.Concurrent.BlockingCollection`1.TryAdd*> or <xref:System.Collections.Concurrent.BlockingCollection`1.TryTake*> method.
> [!IMPORTANT]
>
> - This type implements the <xref:System.IDisposable> interface. When you've finished using the type, you should dispose of it either directly (by calling its `Dispose` method) or indirectly (with a language construct such as `using` in C#). For more information, see [Use an object that implements IDisposable](xref:System.IDisposable#use-an-object-that-implements-idisposable).
> - The <xref:System.Collections.Concurrent.BlockingCollection`1.Dispose> method is not thread-safe. All other public and protected members of <xref:System.Collections.Concurrent.BlockingCollection`1> are thread-safe and can be used concurrently from multiple threads.
<xref:System.Collections.Concurrent.IProducerConsumerCollection`1> represents a collection that allows for thread-safe adding and removal of data. <xref:System.Collections.Concurrent.BlockingCollection`1> is used as a wrapper for an <xref:System.Collections.Concurrent.IProducerConsumerCollection`1> instance, and allows removal attempts from the collection to block until data is available to be removed. Similarly, you can create a <xref:System.Collections.Concurrent.BlockingCollection`1> to enforce an upper bound on the number of data elements allowed in the <xref:System.Collections.Concurrent.IProducerConsumerCollection`1>; addition attempts to the collection may then block until space is available to store the added items. In this manner, <xref:System.Collections.Concurrent.BlockingCollection`1> is similar to a traditional blocking queue data structure, except that the underlying data storage mechanism is abstracted away as an <xref:System.Collections.Concurrent.IProducerConsumerCollection`1>.
<xref:System.Collections.Concurrent.BlockingCollection`1> supports bounding and blocking. Bounding means that you can set the maximum capacity of the collection. Bounding is important in certain scenarios because it enables you to control the maximum size of the collection in memory, and it prevents the producing threads from moving too far ahead of the consuming threads. Multiple threads or tasks can add items to the collection concurrently, and if the collection reaches its specified maximum capacity, the producing threads will block until an item is removed. Multiple consumers can remove items concurrently, and if the collection becomes empty, the consuming threads will block until a producer adds an item. A producing thread can call the <xref:System.Collections.Concurrent.BlockingCollection`1.CompleteAdding*> method to indicate that no more items will be added. Consumers monitor the <xref:System.Collections.Concurrent.BlockingCollection`1.IsCompleted> property to know when the collection is empty and no more items will be added.
<xref:System.Collections.Concurrent.BlockingCollection`1.Add*> and <xref:System.Collections.Concurrent.BlockingCollection`1.Take*> operations are typically performed in a loop. You can cancel a loop by passing in a <xref:System.Threading.CancellationToken> object to the <xref:System.Collections.Concurrent.BlockingCollection`1.TryAdd*> or <xref:System.Collections.Concurrent.BlockingCollection`1.TryTake*> method, and then checking the value of the token's <xref:System.Threading.CancellationToken.IsCancellationRequested> property on each iteration. If the value is `true`, it is up to you to respond the cancellation request by cleaning up any resources and exiting the loop.
When you create a <xref:System.Collections.Concurrent.BlockingCollection`1> object, you can specify not only the bounded capacity but also the type of collection to use. For example, you could specify a <xref:System.Collections.Concurrent.ConcurrentQueue`1> object for first in, first out (FIFO) behavior, or a <xref:System.Collections.Concurrent.ConcurrentStack`1> object for last in, first out (LIFO) behavior. You can use any collection class that implements the <xref:System.Collections.Concurrent.IProducerConsumerCollection`1> interface. The default collection type for <xref:System.Collections.Concurrent.BlockingCollection`1> is <xref:System.Collections.Concurrent.ConcurrentQueue`1>.
Do not modify the underlying collection directly. Use <xref:System.Collections.Concurrent.BlockingCollection`1> methods to add or remove elements. The <xref:System.Collections.Concurrent.BlockingCollection`1> object can become corrupted if you change the underlying collection directly.
<xref:System.Collections.Concurrent.BlockingCollection`1> was not designed with asynchronous access in mind. If your application requires asynchronous producer/consumer scenarios, consider using <xref:System.Threading.Channels.Channel`1> instead.
## Examples
The following example shows how to add and take items concurrently from a blocking collection:
:::code language="csharp" source="~/snippets/csharp/System.Collections.Concurrent/BlockingCollectionT/Overview/blockingcoll.cs" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Concurrent/BlockingCollectionT/Overview/blockingcoll.fs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/System.Collections.Concurrent/BlockingCollectionT/Overview/blockingcoll.vb" id="Snippet1":::
]]></format>
</remarks>
<threadsafe>The Dispose method is not thread-safe. All other public and protected members of <see cref="T:System.Collections.Concurrent.BlockingCollection`1" /> are thread-safe and may be used concurrently from multiple threads.</threadsafe>
<related type="Article" href="/dotnet/standard/collections/thread-safe/">Thread-Safe Collections</related>
<related type="Article" href="/dotnet/standard/collections/thread-safe/blockingcollection-overview">BlockingCollection Overview</related>
<related type="Article" href="/dotnet/standard/collections/thread-safe/how-to-add-bounding-and-blocking">How to: Add Bounding and Blocking Functionality to a Collection Class</related>
</Docs>
<Members>
<MemberGroup MemberName=".ctor">
<AssemblyInfo>
<AssemblyName>System.Collections.Concurrent</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.14.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Collections.Concurrent.BlockingCollection`1" /> class without an upper-bound.</summary>
</Docs>
</MemberGroup>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public BlockingCollection ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.Concurrent.BlockingCollection`1.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:
 BlockingCollection();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.Concurrent</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.14.0</AssemblyVersion>
<AssemblyVersion>4.0.15.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Collections.Concurrent.BlockingCollection`1" /> class without an upper-bound.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The default underlying collection is a <xref:System.Collections.Concurrent.ConcurrentQueue`1> object, which provides first in, first out (FIFO) behavior.
]]></format>
</remarks>
<related type="Article" href="/dotnet/standard/collections/thread-safe/">Thread-Safe Collections</related>
<related type="Article" href="/dotnet/standard/collections/thread-safe/blockingcollection-overview">BlockingCollection Overview</related>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public BlockingCollection (System.Collections.Concurrent.IProducerConsumerCollection<T> collection);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Collections.Concurrent.IProducerConsumerCollection`1<!T> collection) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.Concurrent.BlockingCollection`1.#ctor(System.Collections.Concurrent.IProducerConsumerCollection{`0})" />
<MemberSignature Language="VB.NET" Value="Public Sub New (collection As IProducerConsumerCollection(Of T))" />
<MemberSignature Language="F#" Value="new System.Collections.Concurrent.BlockingCollection<'T> : System.Collections.Concurrent.IProducerConsumerCollection<'T> -> System.Collections.Concurrent.BlockingCollection<'T>" Usage="new System.Collections.Concurrent.BlockingCollection<'T> collection" />
<MemberSignature Language="C++ CLI" Value="public:
 BlockingCollection(System::Collections::Concurrent::IProducerConsumerCollection<T> ^ collection);" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.Concurrent</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.14.0</AssemblyVersion>
<AssemblyVersion>4.0.15.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="collection" Type="System.Collections.Concurrent.IProducerConsumerCollection<T>" />
</Parameters>
<Docs>
<param name="collection">The collection to use as the underlying data store.</param>
<summary>Initializes a new instance of the <see cref="T:System.Collections.Concurrent.BlockingCollection`1" /> class without an upper-bound and using the provided <see cref="T:System.Collections.Concurrent.IProducerConsumerCollection`1" /> as its underlying data store.</summary>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentNullException">The <paramref name="collection" /> argument is null.</exception>
<related type="Article" href="/dotnet/standard/collections/thread-safe/">Thread-Safe Collections</related>
<related type="Article" href="/dotnet/standard/collections/thread-safe/blockingcollection-overview">BlockingCollection Overview</related>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public BlockingCollection (int boundedCapacity);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(int32 boundedCapacity) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.Concurrent.BlockingCollection`1.#ctor(System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (boundedCapacity As Integer)" />
<MemberSignature Language="F#" Value="new System.Collections.Concurrent.BlockingCollection<'T> : int -> System.Collections.Concurrent.BlockingCollection<'T>" Usage="new System.Collections.Concurrent.BlockingCollection<'T> boundedCapacity" />
<MemberSignature Language="C++ CLI" Value="public:
 BlockingCollection(int boundedCapacity);" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.Concurrent</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.14.0</AssemblyVersion>
<AssemblyVersion>4.0.15.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="boundedCapacity" Type="System.Int32" />
</Parameters>
<Docs>
<param name="boundedCapacity">The bounded size of the collection.</param>
<summary>Initializes a new instance of the <see cref="T:System.Collections.Concurrent.BlockingCollection`1" /> class with the specified upper-bound.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The default underlying collection is a <xref:System.Collections.Concurrent.ConcurrentQueue`1>.
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="boundedCapacity" /> is not a positive value.</exception>
<related type="Article" href="/dotnet/standard/collections/thread-safe/">Thread-Safe Collections</related>
<related type="Article" href="/dotnet/standard/collections/thread-safe/blockingcollection-overview">BlockingCollection Overview</related>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public BlockingCollection (System.Collections.Concurrent.IProducerConsumerCollection<T> collection, int boundedCapacity);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Collections.Concurrent.IProducerConsumerCollection`1<!T> collection, int32 boundedCapacity) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.Concurrent.BlockingCollection`1.#ctor(System.Collections.Concurrent.IProducerConsumerCollection{`0},System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (collection As IProducerConsumerCollection(Of T), boundedCapacity As Integer)" />
<MemberSignature Language="F#" Value="new System.Collections.Concurrent.BlockingCollection<'T> : System.Collections.Concurrent.IProducerConsumerCollection<'T> * int -> System.Collections.Concurrent.BlockingCollection<'T>" Usage="new System.Collections.Concurrent.BlockingCollection<'T> (collection, boundedCapacity)" />
<MemberSignature Language="C++ CLI" Value="public:
 BlockingCollection(System::Collections::Concurrent::IProducerConsumerCollection<T> ^ collection, int boundedCapacity);" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.Concurrent</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.14.0</AssemblyVersion>
<AssemblyVersion>4.0.15.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="collection" Type="System.Collections.Concurrent.IProducerConsumerCollection<T>" />
<Parameter Name="boundedCapacity" Type="System.Int32" />
</Parameters>
<Docs>
<param name="collection">The collection to use as the underlying data store.</param>
<param name="boundedCapacity">The bounded size of the collection.</param>
<summary>Initializes a new instance of the <see cref="T:System.Collections.Concurrent.BlockingCollection`1" /> class with the specified upper-bound and using the provided <see cref="T:System.Collections.Concurrent.IProducerConsumerCollection`1" /> as its underlying data store.</summary>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentNullException">The <paramref name="collection" /> argument is null.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="boundedCapacity" /> is not a positive value.</exception>
<exception cref="T:System.ArgumentException">The supplied <paramref name="collection" /> contains more values than is permitted by <paramref name="boundedCapacity" />.</exception>
<related type="Article" href="/dotnet/standard/collections/thread-safe/">Thread-Safe Collections</related>
<related type="Article" href="/dotnet/standard/collections/thread-safe/blockingcollection-overview">BlockingCollection Overview</related>
</Docs>
</Member>
<MemberGroup MemberName="Add">
<AssemblyInfo>
<AssemblyName>System.Collections.Concurrent</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.14.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Adds the item to the <see cref="T:System.Collections.Concurrent.BlockingCollection`1" />.</summary>
<related type="Article" href="/dotnet/standard/collections/thread-safe/">Thread-Safe Collections</related>
<related type="Article" href="/dotnet/standard/collections/thread-safe/blockingcollection-overview">BlockingCollection Overview</related>
</Docs>
</MemberGroup>
<Member MemberName="Add">
<MemberSignature Language="C#" Value="public void Add (T item);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Add(!T item) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.Concurrent.BlockingCollection`1.Add(`0)" />
<MemberSignature Language="VB.NET" Value="Public Sub Add (item As T)" />
<MemberSignature Language="F#" Value="member this.Add : 'T -> unit" Usage="blockingCollection.Add item" />
<MemberSignature Language="C++ CLI" Value="public:
 void Add(T item);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.Concurrent</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.14.0</AssemblyVersion>
<AssemblyVersion>4.0.15.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="item" Type="T" />
</Parameters>
<Docs>
<param name="item">The item to be added to the collection. The value can be a null reference.</param>
<summary>Adds the item to the <see cref="T:System.Collections.Concurrent.BlockingCollection`1" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If a bounded capacity was specified when this instance of <xref:System.Collections.Concurrent.BlockingCollection`1> was initialized, a call to Add may block until space is available to store the provided item.
]]></format>
</remarks>
<exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Collections.Concurrent.BlockingCollection`1" /> has been disposed.</exception>
<exception cref="T:System.InvalidOperationException">The <see cref="T:System.Collections.Concurrent.BlockingCollection`1" /> has been marked as complete with regards to additions.
-or-
The underlying collection didn't accept the item.</exception>
<related type="Article" href="/dotnet/standard/collections/thread-safe/">Thread-Safe Collections</related>
<related type="Article" href="/dotnet/standard/collections/thread-safe/blockingcollection-overview">BlockingCollection Overview</related>
</Docs>
</Member>
<Member MemberName="Add">
<MemberSignature Language="C#" Value="public void Add (T item, System.Threading.CancellationToken cancellationToken);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Add(!T item, valuetype System.Threading.CancellationToken cancellationToken) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.Concurrent.BlockingCollection`1.Add(`0,System.Threading.CancellationToken)" />
<MemberSignature Language="VB.NET" Value="Public Sub Add (item As T, cancellationToken As CancellationToken)" />
<MemberSignature Language="F#" Value="member this.Add : 'T * System.Threading.CancellationToken -> unit" Usage="blockingCollection.Add (item, cancellationToken)" />
<MemberSignature Language="C++ CLI" Value="public:
 void Add(T item, System::Threading::CancellationToken cancellationToken);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.Concurrent</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.14.0</AssemblyVersion>
<AssemblyVersion>4.0.15.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="item" Type="T" />
<Parameter Name="cancellationToken" Type="System.Threading.CancellationToken" />
</Parameters>
<Docs>
<param name="item">The item to be added to the collection. The value can be a null reference.</param>
<param name="cancellationToken">A cancellation token to observe.</param>
<summary>Adds the item to the <see cref="T:System.Collections.Concurrent.BlockingCollection`1" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If a bounded capacity was specified when this instance of <xref:System.Collections.Concurrent.BlockingCollection`1> was initialized, a call to <xref:System.Collections.Concurrent.BlockingCollection`1.Add*> may block until space is available to store the provided item.
This method can return early with an <xref:System.OperationCanceledException> if the `cancellationToken` is canceled.
]]></format>
</remarks>
<exception cref="T:System.OperationCanceledException">The <see cref="T:System.Threading.CancellationToken" /> is canceled.</exception>
<exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Collections.Concurrent.BlockingCollection`1" /> has been disposed or the <see cref="T:System.Threading.CancellationTokenSource" /> that owns <paramref name="cancellationToken" /> has been disposed.</exception>
<exception cref="T:System.InvalidOperationException">The <see cref="T:System.Collections.Concurrent.BlockingCollection`1" /> has been marked as complete with regards to additions.
-or-
The underlying collection didn't accept the item.</exception>
<related type="Article" href="/dotnet/standard/collections/thread-safe/">Thread-Safe Collections</related>
<related type="Article" href="/dotnet/standard/collections/thread-safe/blockingcollection-overview">BlockingCollection Overview</related>
</Docs>
</Member>
<MemberGroup MemberName="AddToAny">
<AssemblyInfo>
<AssemblyName>System.Collections.Concurrent</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.14.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Adds the specified item to any one of the specified <see cref="T:System.Collections.Concurrent.BlockingCollection`1" /> instances.</summary>
</Docs>
</MemberGroup>
<Member MemberName="AddToAny">
<MemberSignature Language="C#" Value="public static int AddToAny (System.Collections.Concurrent.BlockingCollection<T>[] collections, T item);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig int32 AddToAny(class System.Collections.Concurrent.BlockingCollection`1<!T>[] collections, !T item) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.Concurrent.BlockingCollection`1.AddToAny(System.Collections.Concurrent.BlockingCollection{`0}[],`0)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function AddToAny (collections As BlockingCollection(Of T)(), item As T) As Integer" />
<MemberSignature Language="F#" Value="static member AddToAny : System.Collections.Concurrent.BlockingCollection<'T>[] * 'T -> int" Usage="System.Collections.Concurrent.BlockingCollection<'T>.AddToAny (collections, item)" />
<MemberSignature Language="C++ CLI" Value="public:
 static int AddToAny(cli::array <System::Collections::Concurrent::BlockingCollection<T> ^> ^ collections, T item);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.Concurrent</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.14.0</AssemblyVersion>
<AssemblyVersion>4.0.15.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="collections" Type="System.Collections.Concurrent.BlockingCollection<T>[]" />
<Parameter Name="item" Type="T" />
</Parameters>
<Docs>
<param name="collections">The array of collections.</param>
<param name="item">The item to be added to one of the collections.</param>
<summary>Adds the specified item to any one of the specified <see cref="T:System.Collections.Concurrent.BlockingCollection`1" /> instances.</summary>
<returns>The index of the collection in the <paramref name="collections" /> array to which the item was added.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If a bounded capacity was specified when all of the <xref:System.Collections.Concurrent.BlockingCollection`1> instances were initialized, a call to AddToAny may block until space is available in one of the collections to store the provided item.
]]></format>
</remarks>
<exception cref="T:System.ObjectDisposedException">At least one of the <see cref="T:System.Collections.Concurrent.BlockingCollection`1" /> instances has been disposed.</exception>
<exception cref="T:System.ArgumentNullException">The <paramref name="collections" /> argument is null.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">The count of <paramref name="collections" /> is greater than the maximum size of 62 for STA and 63 for MTA.</exception>
<exception cref="T:System.ArgumentException">The <paramref name="collections" /> argument is a 0-length array or contains a null element, or at least one of collections has been marked as complete for adding.</exception>
<exception cref="T:System.InvalidOperationException">At least one underlying collection didn't accept the item.</exception>
<related type="Article" href="/dotnet/standard/collections/thread-safe/">Thread-Safe Collections</related>
<related type="Article" href="/dotnet/standard/collections/thread-safe/blockingcollection-overview">BlockingCollection Overview</related>
</Docs>
</Member>
<Member MemberName="AddToAny">
<MemberSignature Language="C#" Value="public static int AddToAny (System.Collections.Concurrent.BlockingCollection<T>[] collections, T item, System.Threading.CancellationToken cancellationToken);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig int32 AddToAny(class System.Collections.Concurrent.BlockingCollection`1<!T>[] collections, !T item, valuetype System.Threading.CancellationToken cancellationToken) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.Concurrent.BlockingCollection`1.AddToAny(System.Collections.Concurrent.BlockingCollection{`0}[],`0,System.Threading.CancellationToken)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function AddToAny (collections As BlockingCollection(Of T)(), item As T, cancellationToken As CancellationToken) As Integer" />
<MemberSignature Language="F#" Value="static member AddToAny : System.Collections.Concurrent.BlockingCollection<'T>[] * 'T * System.Threading.CancellationToken -> int" Usage="System.Collections.Concurrent.BlockingCollection<'T>.AddToAny (collections, item, cancellationToken)" />
<MemberSignature Language="C++ CLI" Value="public:
 static int AddToAny(cli::array <System::Collections::Concurrent::BlockingCollection<T> ^> ^ collections, T item, System::Threading::CancellationToken cancellationToken);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.Concurrent</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.14.0</AssemblyVersion>
<AssemblyVersion>4.0.15.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="collections" Type="System.Collections.Concurrent.BlockingCollection<T>[]" />
<Parameter Name="item" Type="T" />
<Parameter Name="cancellationToken" Type="System.Threading.CancellationToken" />
</Parameters>
<Docs>
<param name="collections">The array of collections.</param>
<param name="item">The item to be added to one of the collections.</param>
<param name="cancellationToken">A cancellation token to observe.</param>
<summary>Adds the specified item to any one of the specified <see cref="T:System.Collections.Concurrent.BlockingCollection`1" /> instances.</summary>
<returns>The index of the collection in the <paramref name="collections" /> array to which the item was added.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If a bounded capacity was specified when all of the <xref:System.Collections.Concurrent.BlockingCollection`1> instances were initialized, a call to AddToAny may block until space is available in one of the collections to store the provided item. This method may return before the item is added to any collection if the `cancellationToken` is canceled before space is available.
]]></format>
</remarks>
<exception cref="T:System.OperationCanceledException">The <see cref="T:System.Threading.CancellationToken" /> is canceled.</exception>
<exception cref="T:System.InvalidOperationException">At least one underlying collection didn't accept the item.</exception>
<exception cref="T:System.ArgumentNullException">The <paramref name="collections" /> argument is null.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">The count of <paramref name="collections" /> is greater than the maximum size of 62 for STA and 63 for MTA.</exception>
<exception cref="T:System.ArgumentException">The <paramref name="collections" /> argument is a 0-length array or contains a null element, or at least one of collections has been marked as complete for adding.</exception>
<exception cref="T:System.ObjectDisposedException">At least one of the <see cref="T:System.Collections.Concurrent.BlockingCollection`1" /> instances has been disposed, or the <see cref="T:System.Threading.CancellationTokenSource" /> that created <paramref name="cancellationToken" /> has been disposed.</exception>
<related type="Article" href="/dotnet/standard/collections/thread-safe/">Thread-Safe Collections</related>
<related type="Article" href="/dotnet/standard/collections/thread-safe/blockingcollection-overview">BlockingCollection Overview</related>
</Docs>
</Member>
<Member MemberName="BoundedCapacity">
<MemberSignature Language="C#" Value="public int BoundedCapacity { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 BoundedCapacity" />
<MemberSignature Language="DocId" Value="P:System.Collections.Concurrent.BlockingCollection`1.BoundedCapacity" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property BoundedCapacity As Integer" />
<MemberSignature Language="F#" Value="member this.BoundedCapacity : int" Usage="System.Collections.Concurrent.BlockingCollection<'T>.BoundedCapacity" />
<MemberSignature Language="C++ CLI" Value="public:
 property int BoundedCapacity { int get(); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.Concurrent</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.14.0</AssemblyVersion>
<AssemblyVersion>4.0.15.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the bounded capacity of this <see cref="T:System.Collections.Concurrent.BlockingCollection`1" /> instance.</summary>
<value>The bounded capacity of this collection, or -1 if no bound was supplied.</value>
<remarks>To be added.</remarks>
<exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Collections.Concurrent.BlockingCollection`1" /> has been disposed.</exception>
<related type="Article" href="/dotnet/standard/collections/thread-safe/">Thread-Safe Collections</related>
<related type="Article" href="/dotnet/standard/collections/thread-safe/blockingcollection-overview">BlockingCollection Overview</related>
</Docs>
</Member>
<Member MemberName="CompleteAdding">
<MemberSignature Language="C#" Value="public void CompleteAdding ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void CompleteAdding() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.Concurrent.BlockingCollection`1.CompleteAdding" />
<MemberSignature Language="VB.NET" Value="Public Sub CompleteAdding ()" />
<MemberSignature Language="F#" Value="member this.CompleteAdding : unit -> unit" Usage="blockingCollection.CompleteAdding " />
<MemberSignature Language="C++ CLI" Value="public:
 void CompleteAdding();" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.Concurrent</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.14.0</AssemblyVersion>
<AssemblyVersion>4.0.15.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Marks the <see cref="T:System.Collections.Concurrent.BlockingCollection`1" /> instances as not accepting any more additions.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
After a collection has been marked as complete for adding, adding to the collection is not permitted and attempts to remove from the collection will not wait when the collection is empty.
]]></format>
</remarks>
<exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Collections.Concurrent.BlockingCollection`1" /> has been disposed.</exception>
<related type="Article" href="/dotnet/standard/collections/thread-safe/">Thread-Safe Collections</related>
<related type="Article" href="/dotnet/standard/collections/thread-safe/blockingcollection-overview">BlockingCollection Overview</related>
</Docs>
</Member>
<Member MemberName="CopyTo">
<MemberSignature Language="C#" Value="public void CopyTo (T[] array, int index);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void CopyTo(!T[] array, int32 index) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.Concurrent.BlockingCollection`1.CopyTo(`0[],System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Sub CopyTo (array As T(), index As Integer)" />
<MemberSignature Language="F#" Value="member this.CopyTo : 'T[] * int -> unit" Usage="blockingCollection.CopyTo (array, index)" />
<MemberSignature Language="C++ CLI" Value="public:
 void CopyTo(cli::array <T> ^ array, int index);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.Concurrent</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.14.0</AssemblyVersion>
<AssemblyVersion>4.0.15.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="array" Type="T[]" />
<Parameter Name="index" Type="System.Int32" />
</Parameters>
<Docs>
<param name="array">The one-dimensional array that is the destination of the elements copied from the <see cref="T:System.Collections.Concurrent.BlockingCollection`1" /> instance. The array must have zero-based indexing.</param>
<param name="index">The zero-based index in <paramref name="array" /> at which copying begins.</param>
<summary>Copies all of the items in the <see cref="T:System.Collections.Concurrent.BlockingCollection`1" /> instance to a compatible one-dimensional array, starting at the specified index of the target array.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
CopyTo represents a snapshot of the collection at a precise point in time. If other threads are adding or removing items while CopyTo is executing, then the elements returned by CopyTo might not represent the state of the collection.
]]></format>
</remarks>
<exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Collections.Concurrent.BlockingCollection`1" /> has been disposed.</exception>
<exception cref="T:System.ArgumentNullException">The <paramref name="array" /> argument is null.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="index" /> argument is less than zero.</exception>
<exception cref="T:System.ArgumentException">The <paramref name="index" /> argument is equal to or greater than the length of the <paramref name="array" />.
The destination array is too small to hold all of the BlockingCollection elements.
The array rank doesn't match.
The array type is incompatible with the type of the BlockingCollection elements.</exception>
<related type="Article" href="/dotnet/standard/collections/thread-safe/">Thread-Safe Collections</related>
<related type="Article" href="/dotnet/standard/collections/thread-safe/blockingcollection-overview">BlockingCollection Overview</related>
</Docs>
</Member>
<Member MemberName="Count">
<MemberSignature Language="C#" Value="public int Count { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 Count" />
<MemberSignature Language="DocId" Value="P:System.Collections.Concurrent.BlockingCollection`1.Count" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Count As Integer" />
<MemberSignature Language="F#" Value="member this.Count : int" Usage="System.Collections.Concurrent.BlockingCollection<'T>.Count" />
<MemberSignature Language="C++ CLI" Value="public:
 property int Count { int get(); };" />
<MemberType>Property</MemberType>
<Implements>
<InterfaceMember>P:System.Collections.Generic.IReadOnlyCollection`1.Count</InterfaceMember>
<InterfaceMember>P:System.Collections.ICollection.Count</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Collections.Concurrent</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.14.0</AssemblyVersion>
<AssemblyVersion>4.0.15.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the number of items contained in the <see cref="T:System.Collections.Concurrent.BlockingCollection`1" />.</summary>
<value>The number of items contained in the <see cref="T:System.Collections.Concurrent.BlockingCollection`1" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If any method in BlockingCollection is executing while the Count property is being accessed, the return value is approximate. Count may reflect a number that is either greater than or less than the actual number of items in the BlockingCollection.
]]></format>
</remarks>
<exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Collections.Concurrent.BlockingCollection`1" /> has been disposed.</exception>
<related type="Article" href="/dotnet/standard/collections/thread-safe/">Thread-Safe Collections</related>
<related type="Article" href="/dotnet/standard/collections/thread-safe/blockingcollection-overview">BlockingCollection Overview</related>
</Docs>
</Member>
<MemberGroup MemberName="Dispose">
<AssemblyInfo>
<AssemblyName>System.Collections.Concurrent</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.14.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Releases all resources used by the current instance of the <see cref="T:System.Collections.Concurrent.BlockingCollection`1" /> class.</summary>
</Docs>
</MemberGroup>
<Member MemberName="Dispose">
<MemberSignature Language="C#" Value="public void Dispose ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Dispose() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.Concurrent.BlockingCollection`1.Dispose" />
<MemberSignature Language="VB.NET" Value="Public Sub Dispose ()" />
<MemberSignature Language="F#" Value="abstract member Dispose : unit -> unit
override this.Dispose : unit -> unit" Usage="blockingCollection.Dispose " />
<MemberSignature Language="C++ CLI" Value="public:
 virtual void Dispose();" />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.IDisposable.Dispose</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Collections.Concurrent</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.14.0</AssemblyVersion>
<AssemblyVersion>4.0.15.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Releases all resources used by the current instance of the <see cref="T:System.Collections.Concurrent.BlockingCollection`1" /> class.</summary>
<remarks>
<format type="text/markdown">< and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose).
> [!NOTE]
> Always call `Dispose` before you release your last reference to the <xref:System.Collections.Concurrent.BlockingCollection`1>. Otherwise, the resources it is using will not be freed until the garbage collector calls the <xref:System.Collections.Concurrent.BlockingCollection`1> object's `Finalize` method.
]]></format>
</remarks>
<related type="Article" href="/dotnet/standard/collections/thread-safe/">Thread-Safe Collections</related>
<related type="Article" href="/dotnet/standard/collections/thread-safe/blockingcollection-overview">BlockingCollection Overview</related>
</Docs>
</Member>
<Member MemberName="Dispose">
<MemberSignature Language="C#" Value="protected virtual void Dispose (bool disposing);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void Dispose(bool disposing) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.Concurrent.BlockingCollection`1.Dispose(System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub Dispose (disposing As Boolean)" />
<MemberSignature Language="F#" Value="abstract member Dispose : bool -> unit
override this.Dispose : bool -> unit" Usage="blockingCollection.Dispose disposing" />
<MemberSignature Language="C++ CLI" Value="protected:
 virtual void Dispose(bool disposing);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.Concurrent</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.14.0</AssemblyVersion>
<AssemblyVersion>4.0.15.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="disposing" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="disposing">Whether being disposed explicitly (true) or due to a finalizer (false).</param>
<summary>Releases resources used by the <see cref="T:System.Collections.Concurrent.BlockingCollection`1" /> instance.</summary>
<remarks>To be added.</remarks>
<related type="Article" href="/dotnet/standard/collections/thread-safe/">Thread-Safe Collections</related>
<related type="Article" href="/dotnet/standard/collections/thread-safe/blockingcollection-overview">BlockingCollection Overview</related>
</Docs>
</Member>
<MemberGroup MemberName="GetConsumingEnumerable">
<AssemblyInfo>
<AssemblyName>System.Collections.Concurrent</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.14.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Provides a consuming <see cref="T:System.Collections.Generic.IEnumerable`1" /> for items in the collection.</summary>
<related type="Article" href="/dotnet/standard/collections/thread-safe/">Thread-Safe Collections</related>
<related type="Article" href="/dotnet/standard/collections/thread-safe/blockingcollection-overview">BlockingCollection Overview</related>
</Docs>
</MemberGroup>
<Member MemberName="GetConsumingEnumerable">
<MemberSignature Language="C#" Value="public System.Collections.Generic.IEnumerable<T> GetConsumingEnumerable ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Collections.Generic.IEnumerable`1<!T> GetConsumingEnumerable() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.Concurrent.BlockingCollection`1.GetConsumingEnumerable" />
<MemberSignature Language="VB.NET" Value="Public Function GetConsumingEnumerable () As IEnumerable(Of T)" />
<MemberSignature Language="F#" Value="member this.GetConsumingEnumerable : unit -> seq<'T>" Usage="blockingCollection.GetConsumingEnumerable " />
<MemberSignature Language="C++ CLI" Value="public:
 System::Collections::Generic::IEnumerable<T> ^ GetConsumingEnumerable();" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.Concurrent</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.14.0</AssemblyVersion>
<AssemblyVersion>4.0.15.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Collections.Generic.IEnumerable<T></ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Provides a consuming <see cref="T:System.Collections.Generic.IEnumerable`1" /> for items in the collection.</summary>
<returns>An <see cref="T:System.Collections.Generic.IEnumerable`1" /> that removes and returns items from the collection.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example shows how to use the <xref:System.Collections.Concurrent.BlockingCollection`1.GetConsumingEnumerable*> method:
:::code language="csharp" source="~/snippets/csharp/System.Collections.Concurrent/BlockingCollectionT/Overview/blockingcoll.cs" id="Snippet4":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Concurrent/BlockingCollectionT/Overview/blockingcoll.fs" id="Snippet4":::
:::code language="vb" source="~/snippets/visualbasic/System.Collections.Concurrent/BlockingCollectionT/Overview/blockingcoll.vb" id="Snippet4":::
]]></format>
</remarks>
<exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Collections.Concurrent.BlockingCollection`1" /> has been disposed.</exception>
<related type="Article" href="/dotnet/standard/collections/thread-safe/">Thread-Safe Collections</related>
<related type="Article" href="/dotnet/standard/collections/thread-safe/blockingcollection-overview">BlockingCollection Overview</related>
</Docs>
</Member>
<Member MemberName="GetConsumingEnumerable">
<MemberSignature Language="C#" Value="public System.Collections.Generic.IEnumerable<T> GetConsumingEnumerable (System.Threading.CancellationToken cancellationToken);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Collections.Generic.IEnumerable`1<!T> GetConsumingEnumerable(valuetype System.Threading.CancellationToken cancellationToken) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.Concurrent.BlockingCollection`1.GetConsumingEnumerable(System.Threading.CancellationToken)" />
<MemberSignature Language="VB.NET" Value="Public Function GetConsumingEnumerable (cancellationToken As CancellationToken) As IEnumerable(Of T)" />
<MemberSignature Language="F#" Value="member this.GetConsumingEnumerable : System.Threading.CancellationToken -> seq<'T>" Usage="blockingCollection.GetConsumingEnumerable cancellationToken" />
<MemberSignature Language="C++ CLI" Value="public:
 System::Collections::Generic::IEnumerable<T> ^ GetConsumingEnumerable(System::Threading::CancellationToken cancellationToken);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.Concurrent</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.14.0</AssemblyVersion>
<AssemblyVersion>4.0.15.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>