Documentation ¶
Index ¶
- func Prefix(key string, prefix string) string
- type Backend
- type Broker
- type Canceller
- type ChannelMgr
- type CronDescriber
- type Job
- type JobQueue
- func (mq *JobQueue) Cancel(id string) error
- func (mq *JobQueue) ListChannel() ([]string, error)
- func (mq *JobQueue) ListSubject(channel string) ([]string, error)
- func (mq *JobQueue) Next(channel string, subject string, data []byte) (*Task, error)
- func (mq *JobQueue) Publish(channel string, subject string, data []byte) (*Task, error)
- func (mq *JobQueue) Register(subject string, job Job)
- func (mq *JobQueue) RegisterReceiver(receiver func(*TaskStatus) error)
- func (mq *JobQueue) SendTask(task *Task) error
- func (mq *JobQueue) StartReceiver(numWorkers int)
- func (mq *JobQueue) StartWorker(channel string, numWorkers int)
- func (mq *JobQueue) StopReceiver()
- func (mq *JobQueue) StopWorker()
- type MsgHead
- type Status
- type Task
- type TaskStatus
- type Worker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Backend ¶
type Backend interface { Canceller ChannelMgr FeedBack(taskStatus *TaskStatus) (err error) GetFeedback() (taskStatus *TaskStatus, err error) }
type ChannelMgr ¶
type CronDescriber ¶
type CronDescriber interface {
CronSpec() string
}
type JobQueue ¶
type JobQueue struct {
// contains filtered or unexported fields
}
func NewJobQueue ¶
func (*JobQueue) ListChannel ¶
func (*JobQueue) RegisterReceiver ¶
func (mq *JobQueue) RegisterReceiver(receiver func(*TaskStatus) error)
func (*JobQueue) StartReceiver ¶
func (*JobQueue) StartWorker ¶
func (*JobQueue) StopReceiver ¶
func (mq *JobQueue) StopReceiver()
func (*JobQueue) StopWorker ¶
func (mq *JobQueue) StopWorker()
type Task ¶
type Task struct { MsgHead Data []byte `json:"data,omitempty"` CreatedAt time.Time `json:"created_at"` }
func (*Task) Cancelled ¶
func (task *Task) Cancelled() *TaskStatus
func (*Task) Failed ¶
func (task *Task) Failed(traceback error) *TaskStatus
func (*Task) Pending ¶
func (task *Task) Pending() *TaskStatus
func (*Task) Running ¶
func (task *Task) Running() *TaskStatus
func (*Task) Success ¶
func (task *Task) Success(result interface{}) *TaskStatus
type TaskStatus ¶
Click to show internal directories.
Click to hide internal directories.