common

package
v4.2.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2023 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 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
}

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 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 returns worker list associated with the pool.
	Workers() (workers []*worker.Process)
	// QueueSize can be implemented on the pool to provide the requests 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) (*payload.Payload, 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