eeproxy

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScaleDownError errors.Code = iota + errorBase
	InvalidUUIDError
	InvalidAppTypeError
)
View Source
const (
	InvokeFlagReadOnly invokeFlag = 1 << iota
	InvokeFlagTrace
)
View Source
const (
	CodeBits = 24
	CodeMask = (1 << CodeBits) - 1
)
View Source
const (
	JavaEE = "javaee"
)
View Source
const (
	LogFlagTrace logFlag = 1 << iota
)
View Source
const (
	ModuleName = "eeproxy"
)
View Source
const OperationTimeout = 3 * time.Second
View Source
const (
	PythonEE = "pyee"
)

Variables

This section is empty.

Functions

func StatusToCodeAndFlag added in v1.2.9

func StatusToCodeAndFlag(code errors.Code) (errors.Code, int)

Types

type CallContext

type CallContext interface {
	GetValue(key []byte) ([]byte, error)
	SetValue(key []byte, value []byte) ([]byte, error)
	DeleteValue(key []byte) ([]byte, error)
	ArrayDBContains(prefix, value []byte, limit int64) (bool, int, int, error)
	GetInfo() *codec.TypedObj
	GetBalance(addr module.Address) *big.Int
	OnEvent(addr module.Address, indexed, data [][]byte) error
	OnResult(status error, flag int, steps *big.Int, result *codec.TypedObj)
	OnCall(from, to module.Address, value, limit *big.Int, dataType string, dataObj *codec.TypedObj)
	OnAPI(status error, info *scoreapi.Info)
	OnSetFeeProportion(portion int)
	SetCode(code []byte) error
	GetObjGraph(bool) (int, []byte, []byte, error)
	SetObjGraph(flags bool, nextHash int, objGraph []byte) error
	Logger() log.Logger
}

type CodeState

type CodeState struct {
	NexHash   int
	GraphHash []byte
	PrevEID   int
}

type Engine

type Engine interface {
	Type() string
	Init(net, addr string) error
	SetInstances(n int) error
	OnAttach(uid string) bool
	OnEnd(uid string) bool
	Kill(uid string) (bool, error)
	OnConnect(conn ipc.Connection, version uint16) error
	OnClose(conn ipc.Connection) bool
}

func AllocEngines

func AllocEngines(l log.Logger, names ...string) ([]Engine, error)

func NewJavaEE

func NewJavaEE(logger log.Logger) (Engine, error)

func NewPythonEE

func NewPythonEE(logger log.Logger) (Engine, error)

type Executor

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

func (*Executor) Get

func (e *Executor) Get(name string) Proxy

func (*Executor) Kill

func (e *Executor) Kill()

func (*Executor) Release

func (e *Executor) Release()

type InstanceStatus

type InstanceStatus int

func (InstanceStatus) String

func (s InstanceStatus) String() string

type Manager

type Manager interface {
	GetExecutor(pr RequestPriority) *Executor
	SetInstances(total, tx, query int) error
	Loop() error
	Close() error
}

func NewManager

func NewManager(net, addr string, l log.Logger, engines ...Engine) (Manager, error)

type ManagerProxy

type ManagerProxy interface {
	Run(uuid string) error
	Kill(uuid string) error
}

type Message

type Message uint

type Proxy

type Proxy interface {
	Invoke(ctx CallContext, code string, readOnly bool, from, to module.Address,
		value, limit *big.Int, method string, params *codec.TypedObj,
		cid []byte, eid int, state *CodeState) error
	SendResult(ctx CallContext, status error, steps *big.Int, result *codec.TypedObj, eid int, last int) error
	GetAPI(ctx CallContext, code string) error
	Release()
	Kill() error
}

type RequestPriority

type RequestPriority int
const (
	ForTransaction RequestPriority = iota
	ForQuery
)

Jump to

Keyboard shortcuts

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