messages

package
v0.0.0-...-3e52749 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TagInvalid int = iota

	TagManualPolicy

	TagNoWaitPolicy

	TagMeasuredPolicy

	TagStep

	TagDelay

	TagReset

	TagGetStatus

	TagAutoStep
)
View Source
const (
	PolicyInvalid int = iota
	PolicyNoWait
	PolicyMeasured
	PolicyManual
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoStep

type AutoStep struct {
	sm.EnvelopeState

	Guard int64
}

AutoStep is the message that requests the simulated time move forward by one step as a result of a wall clock timer expiring. As this event may be in-flight when the policy authorizing it is changed, the message includes the policy generation number as a guard. That number must match the current policy generation for it to be processed.

func NewAutoStep

func NewAutoStep(
	ctx context.Context,
	guard int64,
	ch chan *sm.Response) *AutoStep

func (*AutoStep) String

func (m *AutoStep) String() string

type BasePolicy

type BasePolicy interface {
	sm.Envelope

	GetGuard() int64
}

type Delay

type Delay struct {
	sm.EnvelopeState

	DueTime int64
}

Delay is the message to request that the a response be sent only when the simulated time passes the value stored as DueTime.

func NewDelay

func NewDelay(ctx context.Context, dueTime int64, ch chan *sm.Response) *Delay

func (*Delay) String

func (m *Delay) String() string

type GetStatus

type GetStatus struct {
	sm.EnvelopeState
}

GetStatus is the message to request the simulated time service's current execution status.

func NewGetStatus

func NewGetStatus(ctx context.Context, ch chan *sm.Response) *GetStatus

func (*GetStatus) String

func (m *GetStatus) String() string

type ManualPolicy

type ManualPolicy struct {
	sm.EnvelopeState

	Guard int64
}

ManualPolicy contains a request for the simulated time service to use the manual step policy.

func NewManualPolicy

func NewManualPolicy(
	ctx context.Context,
	guard int64,
	ch chan *sm.Response) *ManualPolicy

func NewNoWaitPolicy

func NewNoWaitPolicy(
	ctx context.Context,
	guard int64,
	ch chan *sm.Response) *ManualPolicy

func (*ManualPolicy) GetGuard

func (mp *ManualPolicy) GetGuard() int64

func (*ManualPolicy) String

func (mp *ManualPolicy) String() string

type MeasuredPolicy

type MeasuredPolicy struct {
	sm.EnvelopeState

	Guard int64
	Delay time.Duration
}

MeasuredPolicy contains a request for the simulated time service to use the policy that automatically advances simulated time at a given wall clock rate.

func NewMeasuredPolicy

func NewMeasuredPolicy(
	ctx context.Context,
	guard int64,
	delay time.Duration,
	ch chan *sm.Response) *MeasuredPolicy

func (*MeasuredPolicy) GetGuard

func (mp *MeasuredPolicy) GetGuard() int64

func (*MeasuredPolicy) String

func (mp *MeasuredPolicy) String() string

type NoWaitPolicy

type NoWaitPolicy struct {
	sm.EnvelopeState

	Guard int64
}

NoWaitPolicy contains a request for the simulated time service to use the policy that automatically advances to expire any waiter.

func (*NoWaitPolicy) GetGuard

func (nwp *NoWaitPolicy) GetGuard() int64

func (*NoWaitPolicy) String

func (nwp *NoWaitPolicy) String() string

type Reset

type Reset struct {
	sm.EnvelopeState
}

Reset is the message to force a reset of the simulated time service back to its starting point.

func NewReset

func NewReset(ctx context.Context, ch chan *sm.Response) *Reset

func (*Reset) String

func (m *Reset) String() string

type StatusResponseBody

type StatusResponseBody struct {
	Guard int64

	Waiters int64

	MeasuredDelay time.Duration

	Policy int
}

StatusResponseBody contains the simulated time service's current execution status.

func NewStatusResponseBody

func NewStatusResponseBody(
	guard int64,
	waiters int64,
	measuredDelay time.Duration,
	policy int) *StatusResponseBody

type Step

type Step struct {
	sm.EnvelopeState
}

Step is the message to request that the simulated time move forward by 1 tick.

func NewStep

func NewStep(ctx context.Context, ch chan *sm.Response) *Step

func (*Step) String

func (m *Step) String() string

Jump to

Keyboard shortcuts

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