common

package
v4.9.1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// HeaderContextKey is RR <-> Temporal context key
	HeaderContextKey = &ContextKey{name: "headers"} //nolint:gochecknoglobals
)

Functions

func ActivityHeadersFromCtx

func ActivityHeadersFromCtx(ctx context.Context) *commonpb.Header

Types

type Codec

type Codec interface {
	// Encode encodes messages and context to the payload for the worker
	Encode(ctx *internal.Context, p *payload.Payload, msg ...*internal.Message) error
	// Decode decodes payload from the worker to the proto-message
	Decode(pld *payload.Payload, msg *[]*internal.Message) error
	// DecodeWorkerInfo decode a call to get a worker info ID=0 (initial)
	DecodeWorkerInfo(p *payload.Payload, wi *[]*internal.WorkerInfo) error
}

type Configurer

type Configurer interface {
	// UnmarshalKey takes a single key and unmarshal it into a Struct.
	UnmarshalKey(name string, out any) error
	// Has checks if a config section exists.
	Has(name string) bool
	// GracefulTimeout represents timeout for all servers registered in the endure
	GracefulTimeout() time.Duration
	// RRVersion returns running RR version
	RRVersion() string
	// Experimental returns true if the plugin is experimental
	Experimental() bool
}

type ContextKey

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

func (*ContextKey) String

func (ck *ContextKey) String() string

type Informer

type Informer interface {
	Workers() []*process.State
}

Informer used to get workers from a particular plugin or set of plugins

type Interceptor added in v4.1.0

type Interceptor interface {
	WorkerInterceptor() interceptor.WorkerInterceptor
	Name() string
}

type Pool

type Pool interface {
	// Workers return a worker list associated with the pool.
	Workers() (workers []*worker.Process)
	// RemoveWorker removes worker from the pool.
	RemoveWorker(ctx context.Context) error
	// AddWorker adds worker to the pool.
	AddWorker() error
	// QueueSize can be implemented on the pool to provide the request queue information
	QueueSize() uint64
	// Reset kill all workers inside the watcher and replaces with new
	Reset(ctx context.Context) error
	// Exec payload
	Exec(ctx context.Context, p *payload.Payload, stopCh chan struct{}) (chan *staticPool.PExec, error)
}

type Server

type Server interface {
	NewPool(ctx context.Context, cfg *pool.Config, env map[string]string, _ *zap.Logger) (*staticPool.Pool, error)
}

Server creates workers for the application.

Jump to

Keyboard shortcuts

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