persist

package
v0.0.0-...-a6f45d6 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultNumWorkers is the default maximum number of goroutines Persist can operate at once.
	DefaultNumWorkers = 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// NumWorkers represents the number of goroutines that will be used to execute operations.
	// This value must be at least 1.
	NumWorkers int
	// Persist will log events to this Logger.
	Logger *zap.Logger
}

func DefaultConfig

func DefaultConfig() Config

type Persist

type Persist[F comparable, O operation.Operation[F]] struct {
	Config
	confluence.UnarySink[[]O]
	// contains filtered or unexported fields
}

Persist wraps a kfs.KFS and provides a mechanism for easily executing operations on it. Persist uses a pool of goroutines to execute operations concurrently. To create a new Persist, use persist.New.

func New

func New[F comparable, O operation.Operation[F]](kfs kfs.FS[F], config Config) *Persist[F, O]

New creates a new Persist that wraps the provided kfs.FS.

func (*Persist[K, O]) Flow

func (p *Persist[K, O]) Flow(ctx signal.Context, opts ...confluence.Option)

Jump to

Keyboard shortcuts

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