executionsdk

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Execution

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

Execution exposes execution APIs of MESG.

func New

func New(ps *pubsub.PubSub, service servicesdk.Service, instance *instancesdk.Instance, process *processesdk.Process, execDB database.ExecutionDB) *Execution

New creates a new Execution SDK with given options.

func (*Execution) Execute

func (e *Execution) Execute(processHash, instanceHash, eventHash, parentHash hash.Hash, stepID string, taskKey string, inputData *types.Struct, tags []string) (executionHash hash.Hash, err error)

Execute executes a task tasKey with inputData and tags for service serviceID.

func (*Execution) Get

func (e *Execution) Get(hash hash.Hash) (*execution.Execution, error)

Get returns execution that matches given hash.

func (*Execution) GetStream

func (e *Execution) GetStream(f *Filter) *Listener

GetStream returns execution that matches given hash.

func (*Execution) Listen

func (e *Execution) Listen(instanceHash hash.Hash, f *Filter) (*Listener, error)

Listen listens executions on instance.

func (*Execution) Update

func (e *Execution) Update(executionHash hash.Hash, outputs *types.Struct, reterr error) error

Update updates execution that matches given hash.

type Filter

type Filter struct {
	Statuses     []execution.Status
	InstanceHash hash.Hash
	TaskKey      string
	Tags         []string
}

Filter store fileds for matching executions.

func (*Filter) HasTaskKey

func (f *Filter) HasTaskKey() bool

HasTaskKey returns true if task key is set to specified value.

func (*Filter) Match

func (f *Filter) Match(e *execution.Execution) bool

Match matches execution.

type Listener

type Listener struct {
	// Channel receives matching executions for tasks.
	C chan *execution.Execution
	// contains filtered or unexported fields
}

Listener provides functionalities to listen MESG tasks.

func NewListener

func NewListener(ps *pubsub.PubSub, topic string, f *Filter) *Listener

NewListener creates a new Listener with given sdk.

func (*Listener) Close

func (l *Listener) Close()

Close stops listening for events.

func (*Listener) Listen

func (l *Listener) Listen()

Listen listens executions that match filter.

Jump to

Keyboard shortcuts

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