message

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: GPL-3.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ResultStatus = resultStatusChoice{
	Sent:         0,
	FirstRunning: 1,
	WaitingRetry: 2,
	Running:      3,
	Success:      4,
	Failure:      5,
	Expired:      6,
}

Functions

This section is empty.

Types

type Message

type Message struct {
	Id         string             `json:"id"`
	WorkerName string             `json:"worker_name"`
	FuncArgs   []string           `json:"func_args"` //yjson string slice
	TaskCtl    controller.TaskCtl `json:"task_ctl"`
}

func NewMessage

func NewMessage(ctl controller.TaskCtl) Message

func (Message) IsDelayMessage added in v2.2.0

func (m Message) IsDelayMessage() bool

func (Message) IsRunTime added in v2.2.0

func (m Message) IsRunTime() bool

func (Message) RunTimeAfter added in v2.2.0

func (m Message) RunTimeAfter(t time.Time) bool

func (Message) RunTimeAfterOrEqual added in v2.2.0

func (m Message) RunTimeAfterOrEqual(t time.Time) bool

func (Message) RunTimeBefore added in v2.2.0

func (m Message) RunTimeBefore(t time.Time) bool

func (Message) RunTimeBeforeOrEqual added in v2.2.0

func (m Message) RunTimeBeforeOrEqual(t time.Time) bool

func (Message) RunTimeEqual added in v2.2.0

func (m Message) RunTimeEqual(t time.Time) bool

func (*Message) SetArgs

func (m *Message) SetArgs(args ...interface{}) error

type Result

type Result struct {
	Id         string   `json:"id"`
	Status     int      `json:"status"` // 0:sent , 1:first running , 2: waiting to retry , 3: running , 4: success , 5: Failure
	FuncReturn []string `json:"func_return"`
	RetryCount int      `json:"retry_count"`
}

func NewResult

func NewResult(id string) Result

func (Result) Get

func (r Result) Get(index int, v interface{}) error

func (Result) GetBackendKey

func (r Result) GetBackendKey() string

func (Result) GetBool

func (r Result) GetBool(index int) (bool, error)

func (Result) GetFloat64

func (r Result) GetFloat64(index int) (float64, error)

func (Result) GetInt64

func (r Result) GetInt64(index int) (int64, error)

func (Result) GetInterface

func (r Result) GetInterface(index int) (interface{}, error)

过时: 此方法只能用于v1.0.0,高版本中,如果值为int64,uint64类型,会导致获取的值不对 Deprecated: only can use in v1.0.0

func (Result) GetString

func (r Result) GetString(index int) (string, error)

func (Result) GetUint64

func (r Result) GetUint64(index int) (uint64, error)

func (Result) Gets

func (r Result) Gets(args ...interface{}) error

func (Result) IsFinish

func (r Result) IsFinish() bool

func (Result) IsSuccess

func (r Result) IsSuccess() bool

func (*Result) SetStatusRunning

func (r *Result) SetStatusRunning()

Jump to

Keyboard shortcuts

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