proxy

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Han handler.Ensure
}

type Proxy

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

Proxy is a handler implementation to resolve optional implementations of handler.Cooler and handler.Unwrap. A worker engine may wrap its configured worker handlers within this proxy implementation in order to cover interface requirements for cases where those functions may not be implemented by the wrapped handlers.

func New

func New(c Config) *Proxy

func (*Proxy) Active added in v0.7.0

func (p *Proxy) Active() bool

Active returns the scheduler primitive of the underlying worker handler if that handler implements the handler.Active interface. Otherwise true is returned.

func (*Proxy) Cooler

func (p *Proxy) Cooler() time.Duration

Cooler returns the wait duration of the underlying worker handler if that handler implements the handler.Cooler interface. Otherwise 0 is returned.

func (*Proxy) Ensure

func (p *Proxy) Ensure() error

Ensure executes the business logic of the wrapped worker handler transparently without any additional behaviour change.

func (*Proxy) Unwrap

func (p *Proxy) Unwrap() handler.Ensure

Unwrap returns the wrapped handler implementation of the underlying worker handler if that handler implements the handler.Ensure interface. Otherwise the wrapped handler is returned as is. E.g. we might be dealing with a wrapper chain like this.

metrics -> proxy -> artifact

Jump to

Keyboard shortcuts

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