Ferrous API Reference

All Types / Ferrous.Concurrency

class ChannelSender<T>

public sealed class ChannelSender<T>

Send-only handle for a TypedChannel. Calling Complete consumes the sender handle ([ConsumesSelf]) so Ferrous.Ownership prevents sending after close.

Type Parameters
T
The message payload type.

Methods

public bool TrySend(T item)

Attempts to write item synchronously without blocking.

public ValueTask SendAsync(T item, CancellationToken cancellationToken = default)

Asynchronously writes item to the channel.

public void Complete(Exception? error = null)
[ConsumesSelf]

Marks the channel as complete and consumes this sender handle.