activator

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2019 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrActivatorOverload = errors.New("activator overload")

Functions

This section is empty.

Types

type InfiniteBreaker

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

InfiniteBreaker is basically a short circuit. InfiniteBreaker provides us capability to send unlimited number of requests to the downstream system. This is to be used only when the container concurrency is unset (i.e. infinity). The InfiniteBreaker will, though, block the requests when downstream capacity is 0. TODO(greghaynes) When the old throttler is removed this struct can be private.

func NewInfiniteBreaker

func NewInfiniteBreaker(logger *zap.SugaredLogger) *InfiniteBreaker

NewInfiniteBreaker creates an InfiniteBreaker

func (*InfiniteBreaker) Capacity

func (ib *InfiniteBreaker) Capacity() int

Capacity returns the current capacity of the breaker

func (*InfiniteBreaker) Maybe

func (ib *InfiniteBreaker) Maybe(ctx context.Context, thunk func()) error

Maybe executes thunk when capacity is available

func (*InfiniteBreaker) UpdateConcurrency

func (ib *InfiniteBreaker) UpdateConcurrency(cc int) error

UpdateConcurrency sets the concurrency of the breaker

type RevisionBackendsManager

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

RevisionBackendsManager listens to revision endpoints and keeps track of healthy l4 dests which can be used to reach a revision

func NewRevisionBackendsManager

func NewRevisionBackendsManager(ctx context.Context, tr http.RoundTripper, logger *zap.SugaredLogger) *RevisionBackendsManager

NewRevisionBackendsManager returns a new RevisionBackendsManager with default probe time out.

func NewRevisionBackendsManagerWithProbeFrequency

func NewRevisionBackendsManagerWithProbeFrequency(ctx context.Context, tr http.RoundTripper,
	logger *zap.SugaredLogger, probeFreq time.Duration) *RevisionBackendsManager

NewRevisionBackendsManagerWithProbeFrequency creates a fully spec'd RevisionBackendsManager.

func (*RevisionBackendsManager) UpdateCh

func (rbm *RevisionBackendsManager) UpdateCh() <-chan RevisionDestsUpdate

Returns channel where dests updates are sent to

type RevisionDestsUpdate

type RevisionDestsUpdate struct {
	Rev           types.NamespacedName
	ClusterIPDest string
	Dests         sets.String
}

RevisionDestsUpdate contains the state of healthy l4 dests for talking to a revision and is the primary output from the RevisionBackendsManager system. If a healthy ClusterIP is found then ClusterIPDest will be set to non empty string and Dests will be nil. Otherwise Dests will be set to a slice of healthy l4 dests for reaching the revision.

type Throttler

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

Throttler load balances requests to revisions based on capacity. When `Run` is called it listens for updates to revision backends and decides when and when and where to forward a request.

func NewThrottler

func NewThrottler(breakerParams queue.BreakerParams,
	revisionInformer servinginformers.RevisionInformer,
	endpointsInformer corev1informers.EndpointsInformer,
	logger *zap.SugaredLogger) *Throttler

NewThrottler creates a new Throttler

func (*Throttler) Run

func (t *Throttler) Run(updateCh <-chan RevisionDestsUpdate)

Run starts the throttler and blocks until updateCh is closed.

func (*Throttler) Try

func (t *Throttler) Try(ctx context.Context, revID types.NamespacedName, function func(string) error) error

Try waits for capacity and then executes function, passing in a l4 dest to send a request

Jump to

Keyboard shortcuts

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