insconveyor

package
v0.0.0-...-05bc493 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DisableLogStepInfoMarshaller bool

DisableLogStepInfoMarshaller is for benchmarking

Functions

func ApplyConfigOverrides

func ApplyConfigOverrides(cfg *conveyor.PulseConveyorConfig, p ConfigOverrides)

func DefaultConfig

func DefaultConfig() conveyor.PulseConveyorConfig

func DefaultConfigNoEventless

func DefaultConfigNoEventless() conveyor.PulseConveyorConfig

func NewConveyorDispatcher

func NewConveyorDispatcher(ctx context.Context, conveyor *conveyor.PulseConveyor) beat.Dispatcher

Types

type AppCompartment

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

func NewAppCompartment

func NewAppCompartment(name string, appDeps injector.DependencyRegistry, setupFn ConfigReviserFunc) *AppCompartment

func (*AppCompartment) AppDependencies

func (p *AppCompartment) AppDependencies() injector.DependencyRegistry

func (*AppCompartment) Conveyor

func (p *AppCompartment) Conveyor() *conveyor.PulseConveyor

func (*AppCompartment) GetBeatDispatcher

func (p *AppCompartment) GetBeatDispatcher() beat.Dispatcher

func (*AppCompartment) Init

func (p *AppCompartment) Init(ctx context.Context) error

func (*AppCompartment) SetImposer

func (p *AppCompartment) SetImposer(fn ImposerFunc)

SetImposer sets a handler that can alternate Init() behavior. For tests ONLY.

func (*AppCompartment) Start

func (p *AppCompartment) Start(context.Context) error

func (*AppCompartment) Stop

type AppCompartmentSetup

type AppCompartmentSetup struct {
	// ConveyorConfig provides settings for conveyor.
	ConveyorConfig conveyor.PulseConveyorConfig
	// EventFactoryFn provides event factory for conveyor.
	EventFactoryFn conveyor.PulseEventFactoryFunc
	// Components will be added with conveyor.PulseConveyor.AddManagedComponent().
	Components []managed.Component
	// Dependencies will be added as dependencies to conveyor.PulseConveyor.
	Dependencies *injector.DynamicContainer
}

AppCompartmentSetup is a setup of an app compartment.

func (*AppCompartmentSetup) AddComponent

func (p *AppCompartmentSetup) AddComponent(c managed.Component)

AddComponent is a convenience method to add to the Components field.

func (*AppCompartmentSetup) Injector

type ComponentInterceptFunc

type ComponentInterceptFunc = func(managed.Component) managed.Component

ComponentInterceptFunc allows interception / replacement of conveyor-managed components of an app compartment.

type ConfigOverrides

type ConfigOverrides struct {
	BoostNewSlotDuration time.Duration
	MachineLogger        smachine.SlotMachineLogger
	EventlessSleep       time.Duration
}

type ConfigReviserFunc

ConfigReviserFunc enables AppCompartmentSetup to be revised before creation of an app compartment.

type ConveyorLogger

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

func (ConveyorLogger) CanLogEvent

func (c ConveyorLogger) CanLogEvent(eventType smachine.StepLoggerEvent, stepLevel smachine.StepLogLevel) bool

func (ConveyorLogger) CanLogTestEvent

func (ConveyorLogger) CanLogTestEvent() bool

func (ConveyorLogger) CreateAsyncLogger

func (ConveyorLogger) GetLoggerContext

func (c ConveyorLogger) GetLoggerContext() context.Context

func (ConveyorLogger) GetTracerID

func (c ConveyorLogger) GetTracerID() smachine.TracerID

func (ConveyorLogger) LogAdapter

func (c ConveyorLogger) LogAdapter(data smachine.StepLoggerData, adapterID smachine.AdapterID, callID uint64, fields []logfmt.LogFieldMarshaller)

func (ConveyorLogger) LogEvent

func (c ConveyorLogger) LogEvent(data smachine.StepLoggerData, customEvent interface{}, fields []logfmt.LogFieldMarshaller)

func (ConveyorLogger) LogInternal

func (c ConveyorLogger) LogInternal(data smachine.StepLoggerData, updateType string)

func (ConveyorLogger) LogTestEvent

func (ConveyorLogger) LogTestEvent(smachine.StepLoggerData, interface{})

func (ConveyorLogger) LogUpdate

func (c ConveyorLogger) LogUpdate(data smachine.StepLoggerData, updateData smachine.StepLoggerUpdateData)

type ConveyorLoggerFactory

type ConveyorLoggerFactory struct {
}

func (ConveyorLoggerFactory) CreateStepLogger

func (ConveyorLoggerFactory) LogMachineCritical

func (ConveyorLoggerFactory) LogMachineCritical(slotMachineData smachine.SlotMachineData, msg string)

func (ConveyorLoggerFactory) LogMachineInternal

func (ConveyorLoggerFactory) LogMachineInternal(slotMachineData smachine.SlotMachineData, msg string)

func (ConveyorLoggerFactory) LogStopping

type ConveyorWorker

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

func NewConveyorWorker

func NewConveyorWorker(cycleFn conveyor.PulseConveyorCycleFunc) ConveyorWorker

func (*ConveyorWorker) AttachTo

func (w *ConveyorWorker) AttachTo(conveyor *conveyor.PulseConveyor)

func (*ConveyorWorker) Stop

func (w *ConveyorWorker) Stop()

type DispatchedMessage

type DispatchedMessage struct {
	MessageMeta message.Metadata
	PayloadMeta rms.Meta
}

type ImposedParams

type ImposedParams struct {
	// InitContext provides a context given into Init() of app component (not compartment).
	// This context is cancelled on stop.
	InitContext context.Context
	// AppInject contains dependencies provided from Server to App component
	AppInject injector.DependencyInjector
	// CompartmentSetup is a configuration of conveyor-based app compartment.
	CompartmentSetup AppCompartmentSetup
	// ComponentInterceptFn for use by ServerTemplate.InitTemplate.
	ComponentInterceptFn ComponentInterceptFunc
	// ConveyorCycleFn enables access to conveyor's worker state. See instestconveyor.CycleController
	ConveyorCycleFn conveyor.PulseConveyorCycleFunc
	// EventJournal will be connected to logger of conveyor when is not nil.
	EventJournal *journal.Journal
}

ImposedParams is a set of overrides available to ImposerFunc provided with instestconveyor.ServerTemplate.SetImposer()

type ImposerFunc

type ImposerFunc = func(*ImposedParams)

ImposerFunc enables imposing of test-specific overrides on an app compartment.

type LogCritical

type LogCritical struct {
	*log.Msg `txt:"internal"`

	Message   string `fmt:"internal critical - %s"`
	Component string `txt:"sm"`

	MachineID  string
	SlotID     smachine.SlotID
	SlotStepNo uint32
	CycleNo    uint32
	Error      error  `opt:""`
	Backtrace  string `opt:""`
}

type LogInternal

type LogInternal struct {
	*log.Msg `txt:"internal"`

	Message   string `fmt:"internal - %s"`
	Component string `txt:"sm"`

	MachineID  string
	SlotID     smachine.SlotID
	SlotStepNo uint32
	CycleNo    uint32
	Error      error  `opt:""`
	Backtrace  string `opt:""`
}

type LogStepInfo

type LogStepInfo struct {
	Message string

	MachineID   string
	CycleNo     uint32
	Declaration smachine.StateMachineHelper `fmt:"%T"`
	SlotID      smachine.SlotID
	SlotStepNo  uint32

	CurrentStep string
	NextStep    string `opt:""`

	ExecutionTime  int64 `opt:""`
	InactivityTime int64 `opt:""`

	AdapterID smachine.AdapterID `opt:""`
	CallID    uint64             `opt:""`
}

func (LogStepInfo) GetLogObjectMarshaller

func (v LogStepInfo) GetLogObjectMarshaller() logfmt.LogObjectMarshaller

func (LogStepInfo) MarshalLogObject

func (v LogStepInfo) MarshalLogObject(w logfmt.LogObjectWriter, _ logfmt.LogObjectMetricCollector) (msg string, defMsg bool)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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