controller

package
v1.2.12 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorConnectClose = errors.New("connect is closed")

Functions

This section is empty.

Types

type Controller

type Controller interface {
	// RegisterTask 注册任务
	RegisterTask(name ...string)

	// IsRegisterTask 判断任务是否注册
	IsRegisterTask(name string) bool

	// StartConsuming 开始消费
	StartConsuming(concurrency int, handler task.Processor) (bool, error)

	// StopConsuming 停止消费
	StopConsuming()

	// Publish 任务发布
	Publish(ctx context.Context, t *task.Signature) error

	// GetPendingTasks 获取等待任务
	GetPendingTasks(queue string) ([]*task.Signature, error)

	// GetDelayedTasks 获取延时任务
	GetDelayedTasks() ([]*task.Signature, error)

	// SetConsumingQueue 设置消费队列名称
	SetConsumingQueue(consumingQueue string)

	// SetDelayedQueue 设置延迟队列名称
	SetDelayedQueue(delayedQueue string)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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