Documentation
¶
Index ¶
- func OnEachBatch[T comparable](b *Bus, fn func(ctx context.Context, data []T) error)
- func OnEachBatchTx[T, TTx comparable](b *Bus, fn func(ctx context.Context, tx TTx, data []T) error)
- func RegisterJobSource[T comparable](b *Bus, newJobFn func(data T) (river.JobArgs, *river.InsertOpts))
- func Send[T comparable](ctx context.Context, b *Bus, event T)
- func SendMany[T comparable](ctx context.Context, b *Bus, events []T)
- func SendManyTx[T, TTx comparable](ctx context.Context, b *Bus, tx TTx, events []T)
- func SendTx[T, TTx comparable](ctx context.Context, b *Bus, tx TTx, event T)
- type Bus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OnEachBatch ¶
func OnEachBatch[T comparable](b *Bus, fn func(ctx context.Context, data []T) error)
OnEachBatch registers a handler for a specific event type.
func OnEachBatchTx ¶
func OnEachBatchTx[T, TTx comparable](b *Bus, fn func(ctx context.Context, tx TTx, data []T) error)
OnEachBatchTx registers a handler for a specific event type that is contingent on a transaction.
func RegisterJobSource ¶
func RegisterJobSource[T comparable](b *Bus, newJobFn func(data T) (river.JobArgs, *river.InsertOpts))
RegisterJobSource registers a handler for a specific event type that creates jobs.
func Send ¶
func Send[T comparable](ctx context.Context, b *Bus, event T)
Send sends an event to the bus.
func SendMany ¶
func SendMany[T comparable](ctx context.Context, b *Bus, events []T)
Send sends an event to the bus.
func SendManyTx ¶
func SendManyTx[T, TTx comparable](ctx context.Context, b *Bus, tx TTx, events []T)
SendTx sends an event to the bus that is contingent on a transaction.
Types ¶
Click to show internal directories.
Click to hide internal directories.