Documentation ¶
Index ¶
- Variables
- type CollectFunc
- type Master
- type ProcessFunc
- type State
- type Task
- func (*Task) Descriptor() ([]byte, []int)
- func (m *Task) GetData() *types.Any
- func (m *Task) GetId() string
- func (m *Task) GetSubtasks() []*Task
- func (m *Task) Marshal() (dAtA []byte, err error)
- func (m *Task) MarshalTo(dAtA []byte) (int, error)
- func (m *Task) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Task) ProtoMessage()
- func (m *Task) Reset()
- func (m *Task) Size() (n int)
- func (m *Task) String() string
- func (m *Task) Unmarshal(dAtA []byte) error
- func (m *Task) XXX_DiscardUnknown()
- func (m *Task) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Task) XXX_Merge(src proto.Message)
- func (m *Task) XXX_Size() int
- func (m *Task) XXX_Unmarshal(b []byte) error
- type TaskInfo
- func (*TaskInfo) Descriptor() ([]byte, []int)
- func (m *TaskInfo) GetState() State
- func (m *TaskInfo) GetTask() *Task
- func (m *TaskInfo) Marshal() (dAtA []byte, err error)
- func (m *TaskInfo) MarshalTo(dAtA []byte) (int, error)
- func (m *TaskInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*TaskInfo) ProtoMessage()
- func (m *TaskInfo) Reset()
- func (m *TaskInfo) Size() (n int)
- func (m *TaskInfo) String() string
- func (m *TaskInfo) Unmarshal(dAtA []byte) error
- func (m *TaskInfo) XXX_DiscardUnknown()
- func (m *TaskInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *TaskInfo) XXX_Merge(src proto.Message)
- func (m *TaskInfo) XXX_Size() int
- func (m *TaskInfo) XXX_Unmarshal(b []byte) error
- type Worker
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLengthWork = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowWork = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupWork = fmt.Errorf("proto: unexpected end of group") )
var State_name = map[int32]string{
0: "RUNNING",
1: "SUCCESS",
2: "FAILURE",
}
var State_value = map[string]int32{
"RUNNING": 0,
"SUCCESS": 1,
"FAILURE": 2,
}
Functions ¶
This section is empty.
Types ¶
type CollectFunc ¶
CollectFunc is a callback that is used for collecting the results from a subtask that has been processed.
type Master ¶
type Master struct {
// contains filtered or unexported fields
}
Master is the master for a task. The master will layout the subtasks for the task in etcd and collect them upon completion. The collectFunc callback will be called for each subtask that is collected.
type ProcessFunc ¶
ProcessFunc is a callback that is used for processing a subtask in a task.
type Task ¶
type Task struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Data *types.Any `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` Subtasks []*Task `protobuf:"bytes,3,rep,name=subtasks,proto3" json:"subtasks,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Task) Descriptor ¶
func (*Task) GetSubtasks ¶
func (*Task) ProtoMessage ¶
func (*Task) ProtoMessage()
func (*Task) XXX_DiscardUnknown ¶
func (m *Task) XXX_DiscardUnknown()
func (*Task) XXX_Unmarshal ¶
type TaskInfo ¶
type TaskInfo struct { Task *Task `protobuf:"bytes,1,opt,name=task,proto3" json:"task,omitempty"` State State `protobuf:"varint,2,opt,name=state,proto3,enum=work.State" json:"state,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*TaskInfo) Descriptor ¶
func (*TaskInfo) MarshalToSizedBuffer ¶
func (*TaskInfo) ProtoMessage ¶
func (*TaskInfo) ProtoMessage()
func (*TaskInfo) XXX_DiscardUnknown ¶
func (m *TaskInfo) XXX_DiscardUnknown()
func (*TaskInfo) XXX_Marshal ¶
func (*TaskInfo) XXX_Unmarshal ¶
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
Worker is a worker that will process subtasks in a task. The worker will watch the task collection for tasks added by a master. When a task is added, the worker will claim and process subtasks associated with that task. The processFunc callback will be called for each subtask that needs to be processed in the task.