worker

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2023 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Worker

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

func NewWorker

func NewWorker(n, spwan int, q queue.Queue, enablePoll ...bool) *Worker

func (*Worker) IsBusy

func (w *Worker) IsBusy() bool

func (*Worker) KillTask

func (w *Worker) KillTask(id string) error

func (*Worker) Publish

func (w *Worker) Publish(task queue.Task, callback ...queue.Finalizer) bool

func (*Worker) PublishSync

func (w *Worker) PublishSync(task queue.Task, callback ...queue.Finalizer) error

func (*Worker) PublishSyncTimeout

func (w *Worker) PublishSyncTimeout(task queue.Task, timeout time.Duration, callback ...queue.Finalizer) error

func (*Worker) Run

func (w *Worker) Run()

func (*Worker) SetQueue

func (w *Worker) SetQueue(q queue.Queue)

func (*Worker) Stop

func (w *Worker) Stop()

func (*Worker) Wait

func (w *Worker) Wait(timeout ...time.Duration)

func (*Worker) Working

func (w *Worker) Working() int

Jump to

Keyboard shortcuts

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