ChannelWorker.BoundedHandle<'T> Type
Handle for a running bounded channel worker. Backed by Channel{T} instead of Handle{T}'s unbounded queue, so a producer that outruns the handler waits for room instead of growing memory without limit.
Instance members
| Instance member |
Description
|
||||
Full Usage:
this.Complete
|
Stops accepting new items but lets the worker finish everything already queued — Completion completes once the queue drains. The graceful counterpart to cancelling the token passed to startBounded, which abandons the queue as soon as the handler in progress returns and can leave items unprocessed. Idempotent — safe to call more than once, or after the worker has already stopped. |
||||
|
The task representing the worker loop. Completes once the cancellation token passed to
|
||||
Full Usage:
this.PendingCount
Returns: int
|
Current number of queued (unprocessed) items.
|
||||
Full Usage:
this.PostAsync
Parameters:
'T
-
The item to enqueue for processing.
ct : CancellationToken
-
Cancellation token for this call.
Returns: Task
|
Waits for room, then queues item.
|
||||
Full Usage:
this.TryPost
Parameters:
'T
-
The item to enqueue for processing.
Returns: bool
|
Queues item if there is room;
|
TDesu.FSharp