task

package
v0.0.0-...-9bd2c4f Latest Latest
Warning

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

Go to latest
Published: May 15, 2018 License: BSD-3-Clause Imports: 9 Imported by: 12

Documentation

Overview

Package task is a generated protocol buffer package.

It is generated from these files:

github.com/GoCollaborate/src/artifacts/task/task.proto

It has these top-level messages:

TaskPayload

Index

Constants

View Source
const (
	SHORT taskType = iota
	LONG
	ROUTINE
	PERMANENT
)
View Source
const (
	BASE taskPriority = iota
	LOW
	MEDIUM
	HIGH
	URGENT
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Background

type Background chan *Job

func NewBackground

func NewBackground() *Background

func (*Background) Close

func (bg *Background) Close()

func (*Background) Done

func (bg *Background) Done() *Job

func (*Background) Mount

func (bg *Background) Mount(job *Job)

type Collection

type Collection []interface{}

func NewCollection

func NewCollection() *Collection

func (*Collection) Append

func (cg *Collection) Append(cs ...interface{}) *Collection

func (*Collection) Filter

func (cg *Collection) Filter(f func(interface{}) bool) *Collection

func (*Collection) IsEmpty

func (cg *Collection) IsEmpty() bool

func (*Collection) Length

func (cg *Collection) Length() int

type Job

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

func MakeJob

func MakeJob(s ...*Stage) *Job

func (*Job) Back

func (j *Job) Back() *Stage

func (*Job) Curr

func (j *Job) Curr() *Stage

func (*Job) Exes

func (j *Job) Exes(i int) ([]string, error)

func (*Job) Front

func (j *Job) Front() *Stage

func (*Job) Id

func (j *Job) Id() string

func (*Job) Init

func (j *Job) Init(s *Stage) *Stage

func (*Job) InsertAfter

func (j *Job) InsertAfter(aft *Stage, curr *Stage) *Stage

func (*Job) InsertBefore

func (j *Job) InsertBefore(bef *Stage, curr *Stage) *Stage

func (*Job) Len

func (j *Job) Len() int

func (*Job) PushBack

func (j *Job) PushBack(back *Stage) *Stage

func (*Job) PushFront

func (j *Job) PushFront(front *Stage) *Stage

func (*Job) Stacks

func (j *Job) Stacks(stacks ...string) *Job

func (*Job) Tasks

func (j *Job) Tasks(tsks ...*Task)

type Stage

type Stage struct {
	TaskSet map[int]*Task
	// contains filtered or unexported fields
}

func MakeStage

func MakeStage(prev *Stage, next *Stage, tset ...map[int]*Task) *Stage

func (*Stage) Next

func (s *Stage) Next() *Stage

func (*Stage) Prev

func (s *Stage) Prev() *Stage

type Task

type Task struct {
	Type       taskType
	Priority   taskPriority
	Consumable string
	Source     Collection
	Result     Collection
	Context    *TaskContext
	Stage      int
}

type TaskContext

type TaskContext struct {
	Context map[string]interface{}
}

func NewTaskContext

func NewTaskContext(ctx interface{}) *TaskContext

func (*TaskContext) Entries

func (this *TaskContext) Entries() map[string]interface{}

func (*TaskContext) Get

func (this *TaskContext) Get(key string) (interface{}, error)

func (*TaskContext) Set

func (this *TaskContext) Set(key string, val interface{})

type TaskFuture

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

func NewTaskFuture

func NewTaskFuture(in *Task) *TaskFuture

func (*TaskFuture) Close

func (tf *TaskFuture) Close()

func (*TaskFuture) Done

func (tf *TaskFuture) Done() bool

func (*TaskFuture) Error

func (tf *TaskFuture) Error() error

func (*TaskFuture) IsDone

func (tf *TaskFuture) IsDone() chan bool

func (*TaskFuture) Receive

func (tf *TaskFuture) Receive() *Task

func (*TaskFuture) Return

func (tf *TaskFuture) Return(out bool)

type TaskPayload

type TaskPayload struct {
	Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
}

func (*TaskPayload) Descriptor

func (*TaskPayload) Descriptor() ([]byte, []int)

func (*TaskPayload) GetPayload

func (m *TaskPayload) GetPayload() []byte

func (*TaskPayload) ProtoMessage

func (*TaskPayload) ProtoMessage()

func (*TaskPayload) Reset

func (m *TaskPayload) Reset()

func (*TaskPayload) String

func (m *TaskPayload) String() string

type TaskPriority

type TaskPriority interface {
	GetPriority() taskPriority
}

type TaskType

type TaskType interface {
	GetType() taskType
	GetTimeout() time.Time
}

Jump to

Keyboard shortcuts

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