sequencetaskhelper

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2024 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const END_SEQUENCE = "END_SEQUENCE"
View Source
const START_SEQUENCE = "START_SEQUENCE"

Variables

This section is empty.

Functions

This section is empty.

Types

type SequenceTask

type SequenceTask struct {
	StopWhileMeetErr   bool
	Ch                 chan map[string]interface{}
	SeqNum             int
	SeqNumMutex        sync.RWMutex
	CurrentRunningTask int
	ChStatus           string
	TaskFunc           func(map[string]interface{}) error
	RecordSuccessFunc  func(map[string]interface{})
	RecordFailFunc     func(map[string]interface{})
	DeleteTaskCh       chan func(map[string]interface{}) bool // this is insecure when task is executing, so need to stop execute when end current, then delete
}

func NewSequenceTask

func NewSequenceTask(
	stopWhileMeetErr bool,
	seqNum int,
	taskFunc func(map[string]interface{}) error,
	recordSuccessFunc func(map[string]interface{}),
	recordFailFunc func(map[string]interface{}),
) (sequenceTask SequenceTask)

func (*SequenceTask) AddTask

func (a *SequenceTask) AddTask(data map[string]interface{})

func (*SequenceTask) DeleteTask

func (a *SequenceTask) DeleteTask(filter func(map[string]interface{}) bool)

func (*SequenceTask) End

func (a *SequenceTask) End()

func (*SequenceTask) ReloadTask

func (a *SequenceTask) ReloadTask(data []map[string]interface{})

func (*SequenceTask) Start

func (a *SequenceTask) Start()

Jump to

Keyboard shortcuts

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