Update
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
using System.Collections.Concurrent;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using ConsoleApp2.Entities;
|
||||
|
||||
namespace ConsoleApp2.Services;
|
||||
|
||||
/// <summary>
|
||||
/// 数据队列
|
||||
/// </summary>
|
||||
public class DataRecordQueue : IDisposable
|
||||
{
|
||||
private readonly BlockingCollection<DataRecord> _queue;
|
||||
@@ -17,7 +19,7 @@ public class DataRecordQueue : IDisposable
|
||||
|
||||
public DataRecordQueue()
|
||||
{
|
||||
_queue = new BlockingCollection<DataRecord>();
|
||||
_queue = new BlockingCollection<DataRecord>(200_000); // 队列最长为20W条记录
|
||||
}
|
||||
|
||||
public bool TryDequeue([MaybeNullWhen(false)] out DataRecord record)
|
||||
|
Reference in New Issue
Block a user