task

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2018 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve

func Serve(cfg *config.Config)

Types

type Controller

type Controller struct {
	*pi.Pi
	// contains filtered or unexported fields
}

func NewController

func NewController(pi *pi.Pi, hostname string) *Controller

func (*Controller) ExtractTasks

func (c *Controller) ExtractTasks()

func (*Controller) GetTaskLength

func (c *Controller) GetTaskLength() uint32

func (*Controller) HandleTask

func (c *Controller) HandleTask(taskId string, cb func()) error

func (*Controller) HandleTasks

func (c *Controller) HandleTasks()

func (*Controller) IsRunningExceed

func (c *Controller) IsRunningExceed() bool

func (*Controller) Serve

func (c *Controller) Serve()

type Processor

type Processor struct {
	Task    *models.Task
	TLogger *logger.Logger
}

func NewProcessor

func NewProcessor(task *models.Task, tLogger *logger.Logger) *Processor

func (*Processor) Post

func (p *Processor) Post() error

Post process when task is done

func (*Processor) Pre

func (p *Processor) Pre() error

Post process when task is start

type Server

type Server struct {
	*pi.Pi
	// contains filtered or unexported fields
}

func (*Server) CreateTask

func (p *Server) CreateTask(ctx context.Context, req *pb.CreateTaskRequest) (*pb.CreateTaskResponse, error)

func (*Server) DescribeTasks

func (p *Server) DescribeTasks(ctx context.Context, req *pb.DescribeTasksRequest) (*pb.DescribeTasksResponse, error)

func (*Server) RetryTasks

func (p *Server) RetryTasks(ctx context.Context, req *pb.RetryTasksRequest) (*pb.RetryTasksResponse, error)

Jump to

Keyboard shortcuts

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