disadvantages

package
v0.0.0-...-de70ca6 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoJob

func DoJob(pool WorkerPool, job Job) error

func DoJobUpdated

func DoJobUpdated(pool WorkerPool, job Job) error

Types

type Job

type Job interface {
}

A unit of work to be executed against the pool

type Layer1Config

type Layer1Config interface {
	Logger() Logger
}

Configuration for the Layer 1 Object

type Layer1Object

type Layer1Object struct {
	MyConfig     Layer1Config
	MyDependency *Layer2Object
}

Layer 1 Object

func NewLayer1Object

func NewLayer1Object(config Layer1Config) *Layer1Object

type Layer2Config

type Layer2Config interface {
	Logger() Logger
}

Configuration for the Layer 2 Object

type Layer2Object

type Layer2Object struct {
	MyConfig Layer2Config
}

Layer 2 Object

func NewLayer2Object

func NewLayer2Object(config Layer2Config) *Layer2Object

type Loader

type Loader interface {
	LoadAll() ([]Person, error)
}

type Logger

type Logger interface {
}

Stub implementation to make the compiler happy

type PeopleFilterConfig

type PeopleFilterConfig interface {
	DSN() string
}

type Person

type Person struct {
	Name string
}

Some data

func PeopleFilter

func PeopleFilter(cfg PeopleFilterConfig, filter string) ([]Person, error)

func PeopleFilterV2

func PeopleFilterV2(loader Loader, filter string) ([]Person, error)

type PersonLoader

type PersonLoader struct{}

func (*PersonLoader) LoadAll

func (p *PersonLoader) LoadAll(cfg PersonLoaderConfig) ([]Person, error)

type PersonLoaderConfig

type PersonLoaderConfig interface {
	DSN() string
}

type Worker

type Worker interface {
	Do(job Job) error
}

Executes/processes a unit of work and returns

type WorkerPool

type WorkerPool interface {
	GetWorker() Worker
	IsReady() chan struct{}
}

Pool of workers

Jump to

Keyboard shortcuts

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