task

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2018 License: Apache-2.0 Imports: 29 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 {
	// contains filtered or unexported fields
}

func NewController

func NewController(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(ctx context.Context, 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
}

func NewProcessor

func NewProcessor(task *models.Task) *Processor

func (*Processor) Post

func (p *Processor) Post(ctx context.Context) error

Post process when task is done

func (*Processor) Pre

func (p *Processor) Pre(ctx context.Context) error

Post process when task is start

type Server

type Server struct {
	// 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