ants

package
v1.0.0-dev.119 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PluginsRoot = "boost.factory.ants.plugins"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Middleware

type Middleware interface {

	// Before method you perform before the task
	Before(ctx context.Context) context.Context

	// After method you perform after the task
	After(ctx context.Context)
}

Middleware interface for task middlewares

type Task

type Task func(ctx context.Context) context.Context

Task interface for tasks

type Wrapper

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

Wrapper

func NewWrapper

func NewWrapper(pool *ants.Pool, middlewares ...Middleware) *Wrapper

NewWrapper generates an instance of giants wrapper.

func (*Wrapper) AsyncSubmit

func (a *Wrapper) AsyncSubmit(ctx context.Context, task Task) error

AsyncSubmit sends a task to ant

func (*Wrapper) Submit

func (a *Wrapper) Submit(ctx context.Context, task Task, wg *sync.WaitGroup) error

Submit sends a task to ant, needs a sync.WaitGroup

Jump to

Keyboard shortcuts

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