tasks

package
v0.0.0-...-36cd75f Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2019 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Routes

func Routes(r *gin.Engine) *gin.RouterGroup

func TasksWebsocketEndpoint

func TasksWebsocketEndpoint(c *gin.Context)

Types

type Task

type Task struct {
	ID            uuid.UUID
	Name          string
	Progress      int `json:"-"`
	STAN          stan.Conn
	NATS          *nats.Conn
	TaskFunction  func(*Task) `json:"-"`
	TrackProgress bool        `json:"-"`
	// contains filtered or unexported fields
}

Instance of an executing task on a worker

func New

func New(f func(*Task)) *Task

func New(c stan.Conn, t *Task) string {

func (*Task) Delay

func (t *Task) Delay()

Put this task in a queue Assigns an ID for a queued task

func (*Task) Process

func (t *Task) Process()

func (*Task) UpdateProgress

func (t *Task) UpdateProgress(progress int)

Jump to

Keyboard shortcuts

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