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 = -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 = -1, Optional resumeWriterThreshold As Long = -1, Optional minimumSegmentSize As Integer = -1, Optional useSynchronizationContext As Boolean = true)
參數
- pool
- MemoryPool<Byte>
用於緩衝區管理的記憶體區塊池。
- readerScheduler
- PipeScheduler
PipeScheduler用於執行PipeReader回調與非同步延續。
- writerScheduler
- PipeScheduler
它們 PipeScheduler 用來執行 PipeWriter 回調和非同步續接。
- pauseWriterThreshold
- Int64
前FlushAsync(CancellationToken)置的位元組Pipe數量開始阻塞。 值為零則 FlushAsync(CancellationToken) 無法阻擋,實際上使位元組 Pipe 數量無限。
- resumeWriterThreshold
- Int64
當 停止阻塞時的PipeFlushAsync(CancellationToken)位元組數。
- minimumSegmentSize
- Int32
請求的 pool最小段大小。
- useSynchronizationContext
- Boolean
true 若非同步延續應執行於 , SynchronizationContext 則在 被捕獲 false ;否則。 此優先權高於 與 中指定的ReaderSchedulerWriterScheduler排程器。