state

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Version = 1
)

Variables

View Source
var (
	ErrInvalidVersion = fmt.Errorf("invalid version number")
)

Functions

This section is empty.

Types

type AwakeableOption

type AwakeableOption interface {
	// contains filtered or unexported methods
}

type Context

type Context struct {
	context.Context
	// contains filtered or unexported fields
}

func (*Context) After

func (c *Context) After(d time.Duration) restate.After

func (*Context) Awakeable

func (c *Context) Awakeable(opts ...options.AwakeableOption) restate.Awakeable

func (*Context) Clear

func (c *Context) Clear(key string)

func (*Context) ClearAll

func (c *Context) ClearAll()

ClearAll drops all associated keys

func (*Context) Get

func (c *Context) Get(key string, output any, opts ...options.GetOption) error

func (*Context) Key

func (c *Context) Key() string

func (*Context) Keys

func (c *Context) Keys() []string

func (*Context) Log

func (c *Context) Log() *slog.Logger

func (*Context) Object

func (c *Context) Object(service, key, method string, opts ...options.CallOption) restate.CallClient

func (*Context) Rand

func (c *Context) Rand() *rand.Rand

func (*Context) RejectAwakeable

func (c *Context) RejectAwakeable(id string, reason error)

func (*Context) Request added in v0.9.1

func (c *Context) Request() *restate.Request

func (*Context) ResolveAwakeable

func (c *Context) ResolveAwakeable(id string, value any, opts ...options.ResolveAwakeableOption) error

func (*Context) Run

func (c *Context) Run(fn func(ctx restate.RunContext) (any, error), output any, opts ...options.RunOption) error

func (*Context) Select

func (c *Context) Select(futs ...restate.Selectable) restate.Selector

func (*Context) Service

func (c *Context) Service(service, method string, opts ...options.CallOption) restate.CallClient

func (*Context) Set

func (c *Context) Set(key string, value any, opts ...options.SetOption) error

func (*Context) Sleep

func (c *Context) Sleep(d time.Duration) error

type Machine

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

func NewMachine

func NewMachine(handler restate.Handler, conn io.ReadWriter, attemptHeaders map[string][]string) *Machine

func (*Machine) Log

func (m *Machine) Log() *slog.Logger

func (*Machine) Start

func (m *Machine) Start(inner context.Context, dropReplayLogs bool, logHandler slog.Handler) error

Start starts the state machine

func (*Machine) Write

func (m *Machine) Write(message wire.Message)

Jump to

Keyboard shortcuts

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