Documentation
¶
Overview ¶
Package batchque provides functionality for managing and canceling batches of requests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrClosed = errors.New("use of closed connection")
Functions ¶
func CancelFunc ¶
func CancelFunc[K comparable, V any](err error, rr []Request[K, V])
CancelFunc cancels a batch of requests by concurrently calling the CancelFunc method on each request.
Types ¶
type Group ¶
type Group[In, Out any] struct { // contains filtered or unexported fields }
Group is a generic type that manages batching of requests. It collects individual requests with the same input and output types, groups them together, and processes them in batches using a provided function.
type Request ¶
type Request[V, R any] struct { Val V // Input C chan<- R // Result CancelFunc context.CancelCauseFunc // contains filtered or unexported fields }
Request represents a single operation within a batch. It contains the input value, a channel to receive the result, and context management for cancellation.
Click to show internal directories.
Click to hide internal directories.