fanout

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fanout

type Fanout struct {
	// contains filtered or unexported fields
}

Fanout async consume data from chan.

func New

func New(name string, opts ...Option) *Fanout

New new a fanout struct.

func (*Fanout) Close

func (c *Fanout) Close() error

Close close fanout.

func (*Fanout) Do

func (c *Fanout) Do(ctx context.Context, f func(ctx context.Context)) error

Do save a callback func.

type Option

type Option func(*options)

Option is fanout option.

func WithBuffer

func WithBuffer(n int) Option

WithBuffer with the buffer of fanout.

func WithWorker

func WithWorker(n int) Option

WithWorker with the worker of fanout.

Jump to

Keyboard shortcuts

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