mq

package
v1.4.3-poc-rc4 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPushTaskTimeout = errors.New("push task to queue timeout")
)
View Source
var InvalidTaskState = errors.New("invalid TaskState type")
View Source
var TASK_STATE__PENDING = TASK_STATE_UNKNOWN

Functions

This section is empty.

Types

type SetArg

type SetArg interface {
	SetArg(v interface{}) error
}

type Task

type Task interface {
	Subject() string
	ID() string
	State() TaskState
	SetState(TaskState)
}

type TaskBoard

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

func NewTaskBoard

func NewTaskBoard(tm TaskManager) *TaskBoard

func (*TaskBoard) Dispatch

func (b *TaskBoard) Dispatch(ch string, t Task) error

type TaskHeader

type TaskHeader struct {
	TaskUUID
	TaskState
	// contains filtered or unexported fields
}

func (*TaskHeader) SetSubject

func (th *TaskHeader) SetSubject(s string)

func (*TaskHeader) Subject

func (th *TaskHeader) Subject() string

type TaskManager

type TaskManager interface {
	Push(ch string, t Task) error
	Pop(ch string) (Task, error)
	Remove(ch string, id string) error
	Clear(ch string) error
}

type TaskOperator added in v1.1.0

type TaskOperator interface {
	Output(ctx context.Context) (interface{}, error)
	SetArg
}

type TaskState

type TaskState uint8
const (
	TASK_STATE_UNKNOWN TaskState = iota
	TASK_STATE__SUCCEEDED
	TASK_STATE__FAILED
)

func ParseTaskStateFromLabel

func ParseTaskStateFromLabel(s string) (TaskState, error)

func ParseTaskStateFromString

func ParseTaskStateFromString(s string) (TaskState, error)

func (TaskState) ConstValues

func (v TaskState) ConstValues() []enum.IntStringerEnum

func (TaskState) Int

func (v TaskState) Int() int

func (TaskState) Label

func (v TaskState) Label() string

func (TaskState) MarshalText

func (v TaskState) MarshalText() ([]byte, error)

func (*TaskState) Scan

func (v *TaskState) Scan(src interface{}) error

func (*TaskState) SetState

func (v *TaskState) SetState(s TaskState)

func (TaskState) State

func (v TaskState) State() TaskState

func (TaskState) String

func (v TaskState) String() string

func (TaskState) TypeName

func (v TaskState) TypeName() string

func (*TaskState) UnmarshalText

func (v *TaskState) UnmarshalText(data []byte) error

func (TaskState) Value

func (v TaskState) Value() (driver.Value, error)

type TaskUUID

type TaskUUID string

func (*TaskUUID) ID

func (tid *TaskUUID) ID() string

func (*TaskUUID) SetID

func (tid *TaskUUID) SetID(id string)

type TaskWorker

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

func NewTaskWorker

func NewTaskWorker(tm TaskManager, options ...TaskWorkerOption) *TaskWorker

func (*TaskWorker) Context

func (w *TaskWorker) Context() context.Context

func (*TaskWorker) LivenessCheck added in v1.1.0

func (w *TaskWorker) LivenessCheck() map[string]string

func (*TaskWorker) Register

func (w *TaskWorker) Register(router *kit.Router)

func (*TaskWorker) Serve

func (w *TaskWorker) Serve(router *kit.Router) error

func (*TaskWorker) SetDefault added in v1.1.0

func (w *TaskWorker) SetDefault()

func (TaskWorker) WithContextInjector

func (w TaskWorker) WithContextInjector(with contextx.WithContext) *TaskWorker

type TaskWorkerOption

type TaskWorkerOption func(*taskWorkerOption)

func WithChannel

func WithChannel(ch string) TaskWorkerOption

func WithFinishFunc

func WithFinishFunc(fn func(ctx context.Context, t Task)) TaskWorkerOption

func WithWorkerCount

func WithWorkerCount(cnt int) TaskWorkerOption

type WithArg

type WithArg interface {
	Arg() interface{}
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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