PipeOptions 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
使用指定的参数初始化 PipeOptions 类的新实例。
public PipeOptions (System.Buffers.MemoryPool<byte> pool = default, System.IO.Pipelines.PipeScheduler readerScheduler = default, System.IO.Pipelines.PipeScheduler writerScheduler = default, long pauseWriterThreshold = 32768, long resumeWriterThreshold = 16384, int minimumSegmentSize = 2048, bool useSynchronizationContext = true);
public PipeOptions (System.Buffers.MemoryPool<byte> pool = default, System.IO.Pipelines.PipeScheduler readerScheduler = default, System.IO.Pipelines.PipeScheduler writerScheduler = default, long pauseWriterThreshold = -1, long resumeWriterThreshold = -1, int minimumSegmentSize = -1, bool useSynchronizationContext = true);
public PipeOptions (System.Buffers.MemoryPool<byte>? pool = default, System.IO.Pipelines.PipeScheduler? readerScheduler = default, System.IO.Pipelines.PipeScheduler? writerScheduler = default, long pauseWriterThreshold = -1, long resumeWriterThreshold = -1, int minimumSegmentSize = -1, bool useSynchronizationContext = true);
new System.IO.Pipelines.PipeOptions : System.Buffers.MemoryPool<byte> * System.IO.Pipelines.PipeScheduler * System.IO.Pipelines.PipeScheduler * int64 * int64 * int * bool -> System.IO.Pipelines.PipeOptions
Public Sub New (Optional pool As MemoryPool(Of Byte) = Nothing, Optional readerScheduler As PipeScheduler = Nothing, Optional writerScheduler As PipeScheduler = Nothing, Optional pauseWriterThreshold As Long = 32768, Optional resumeWriterThreshold As Long = 16384, Optional minimumSegmentSize As Integer = 2048, Optional useSynchronizationContext As Boolean = true)
Public Sub New (Optional pool As MemoryPool(Of Byte) = Nothing, Optional readerScheduler As PipeScheduler = Nothing, Optional writerScheduler As PipeScheduler = Nothing, Optional pauseWriterThreshold As Long = -1, Optional resumeWriterThreshold As Long = -1, Optional minimumSegmentSize As Integer = -1, Optional useSynchronizationContext As Boolean = true)
参数
- pool
- MemoryPool<Byte>
用于缓冲区管理的内存块池。
- readerScheduler
- PipeScheduler
用于执行 PipeReader 回调和异步延续的 PipeScheduler。
- writerScheduler
- PipeScheduler
用于执行 PipeWriter 回调和异步延续的 PipeScheduler。
- pauseWriterThreshold
- Int64
在 FlushAsync(CancellationToken) 开始阻止之前,Pipe 中的字节数。 零值可防止 FlushAsync(CancellationToken) 进行阻止,从而有效地使 Pipe 中的字节数不受限制。
- resumeWriterThreshold
- Int64
在 FlushAsync(CancellationToken) 停止阻止时,Pipe 中的字节数。
- minimumSegmentSize
- Int32
从 pool
请求的段的最小大小。
- useSynchronizationContext
- Boolean
如果应在捕获异步延续的 SynchronizationContext 上执行异步延续,则为 true
;否则为 false
。 这将优先于 ReaderScheduler 和 WriterScheduler 中指定的计划程序。