task

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Capture added in v1.8.0

type Capture struct {
	RunID     string
	Sequence  uint64
	StartedAt time.Time
}

Capture identifies a dispatch independently of completion/serialization order.

type CaptureClock added in v1.8.0

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

CaptureClock anchors wall-clock timestamps to monotonic elapsed time.

func NewCaptureClock added in v1.8.0

func NewCaptureClock() *CaptureClock

func (*CaptureClock) Next added in v1.8.0

func (c *CaptureClock) Next() (Capture, error)

type Result

type Result struct {
	Capture    Capture
	Task       Task
	StatusCode int
	Duration   time.Duration
	BytesRead  int64
	Error      error
	Meta       map[string]string
}

Result holds the outcome of a driver execution.

type Selector

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

Selector picks tasks by weight using the Vose alias method for O(1) selection.

func NewSelector

func NewSelector(targets []config.TargetConfig) (*Selector, error)

NewSelector builds the alias table from the target list. Panics if targets is empty.

func (*Selector) Examples added in v1.8.0

func (s *Selector) Examples() []Task

Examples expands every configured target once for dry-run output.

func (*Selector) Pick

func (s *Selector) Pick() Task

Pick selects a target with probability proportional to its weight.

type Task

type Task struct {
	URL    string
	Type   string // http | browser | dns | websocket
	Config config.TargetConfig
}

Task is a single unit of work dispatched to a driver.

Jump to

Keyboard shortcuts

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