poller

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithBatchSize

func WithBatchSize(size int) func(*Opts)

Types

type Option

type Option func(*Opts)

type Opts

type Opts struct {
	BatchSize int
}

type Poller

type Poller[T any] interface {
	Poll(context.Context, int) ([]kawa.Message[T], func(), error)
}

type Source

type Source[T any] struct {
	// contains filtered or unexported fields
}

func New

func New[T any](p Poller[T], opts ...Option) *Source[T]

func (*Source[T]) Recv

func (s *Source[T]) Recv(ctx context.Context) (kawa.Message[T], func(), error)

func (*Source[T]) Run

func (s *Source[T]) Run(ctx context.Context) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL