Documentation
¶
Index ¶
- func Offer[C xconstraints.Send[V], V any](ctx context.Context, c C, v V) error
- func OfferSeq[Int constraints.Integer, C xconstraints.Send[V], V any](ctx context.Context, c C, seq iter.Seq[V]) (Int, error)
- func OfferSeqNoError[Int constraints.Integer, C xconstraints.Send[V], V any](ctx context.Context, c C, seq iter.Seq[V]) Int
- func Poll[C xconstraints.Receive[V], V any](ctx context.Context, c C) (V, error)
- func PollSeq[C xconstraints.Receive[V], V any](ctx context.Context, c C) iter.Seq2[V, error]
- func PollSeqNoError[C xconstraints.Receive[V], V any](ctx context.Context, c C) iter.Seq[V]
- func RecvSeq[C xconstraints.Receive[V], V any](c C) iter.Seq[V]
- func SendSeq[Int constraints.Integer, C xconstraints.Send[V], V any](c C, seq iter.Seq[V]) Int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Offer ¶
Offer attempts to send a value on the channel, respecting context cancellation. It returns the context error if the context is cancelled before the send completes.
func OfferSeq ¶
func OfferSeq[Int constraints.Integer, C xconstraints.Send[V], V any](ctx context.Context, c C, seq iter.Seq[V]) (Int, error)
OfferSeq sends all values from the iterator sequence to the channel, respecting context cancellation. It returns the number of values sent and the context error if the context is cancelled.
func OfferSeqNoError ¶
func OfferSeqNoError[Int constraints.Integer, C xconstraints.Send[V], V any](ctx context.Context, c C, seq iter.Seq[V]) Int
OfferSeqNoError sends all values from the iterator sequence to the channel, respecting context cancellation. It returns the number of values sent, discarding any context error.
func Poll ¶
Poll attempts to receive a value from the channel, respecting context cancellation. It returns the context error if the context is cancelled before a value is received.
func PollSeq ¶
PollSeq returns an iterator that receives values from the channel, respecting context cancellation. It yields pairs of (value, error), where error is non-nil when the context is cancelled.
func PollSeqNoError ¶
PollSeqNoError returns an iterator that receives values from the channel, respecting context cancellation. It stops when the context is cancelled, discarding the error.
func RecvSeq ¶
func RecvSeq[C xconstraints.Receive[V], V any](c C) iter.Seq[V]
RecvSeq returns an iterator that yields all values received from the channel until it is closed.
func SendSeq ¶
func SendSeq[Int constraints.Integer, C xconstraints.Send[V], V any](c C, seq iter.Seq[V]) Int
SendSeq sends all values from the iterator sequence to the channel. It returns the number of values sent.
Types ¶
This section is empty.