messenger

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EndpointResolver added in v0.9.0

type EndpointResolver interface {
	AwaitBestAddress(ctx context.Context, model, adapter string) (string, func(), error)
}

type Messenger

type Messenger struct {
	HTTPC *http.Client

	MaxHandlers     int
	ErrorMaxBackoff time.Duration
	// contains filtered or unexported fields
}

func NewMessenger

func NewMessenger(
	ctx context.Context,
	requestsURL string,
	responsesURL string,
	maxHandlers int,
	errorMaxBackoff time.Duration,
	modelScaler ModelScaler,
	resolver EndpointResolver,
	httpClient *http.Client,
) (*Messenger, error)

func (*Messenger) Start

func (m *Messenger) Start(ctx context.Context) error

func (*Messenger) Stop

func (m *Messenger) Stop(ctx context.Context) error

type ModelScaler

type ModelScaler interface {
	LookupModel(ctx context.Context, model, adapter string, selectors []string) (bool, error)
	ScaleAtLeastOneReplica(ctx context.Context, model string) error
}

Jump to

Keyboard shortcuts

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