executor

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrExecutorNotConfigured = errors.New("executor not fully configured")
	ErrCannotHandle          = errors.New("cannot handle job")
)

Functions

This section is empty.

Types

type Executor

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

Executor is a facade over Grav and Reactr that allows executing local OR remote functions with a single call, ensuring there is no difference between them to the caller

func New

func New(log *vlog.Logger, transport *websocket.Transport) *Executor

New creates a new Executor

func (*Executor) Do

func (e *Executor) Do(jobType string, data interface{}, ctx *vk.Ctx) (interface{}, error)

Do executes a local or remote job

func (*Executor) Load

func (e *Executor) Load(runnables []directive.Runnable) error

Load loads Runnables into the executor's Reactr instance And connects them to the Grav instance (currently unused)

func (*Executor) Metrics

func (e *Executor) Metrics() (*rt.ScalerMetrics, error)

Metrics returns the executor's Reactr isntance's internal metrics

func (*Executor) Register

func (e *Executor) Register(jobType string, runner rt.Runnable, opts ...rt.Option) error

Register registers a Runnable

func (*Executor) SetSchedule

func (e *Executor) SetSchedule(sched rt.Schedule) error

SetSchedule adds a Schedule to the executor's Reactr instance

func (*Executor) UseCapabilityConfig

func (e *Executor) UseCapabilityConfig(config rcap.CapabilityConfig) error

UseCapabilityConfig sets up the executor's Reactr instance using the provided capability configuration

Jump to

Keyboard shortcuts

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