Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrExecutorNotExists = errors.New("executor not exists")
)
Functions ¶
func RemoveExecutor ¶
func RemoveExecutor(resourceType, jobName string)
RemoveExecutor removes the executor from the nodeTaskExecutors, found by resource type and job name.
Types ¶
type NodeTaskExecutor ¶
type NodeTaskExecutor struct {
// UpdateNodeTaskStatus defines a function to update the status of the node task.
UpdateNodeTaskStatus UpdateNodeTaskStatus
// contains filtered or unexported fields
}
func GetExecutor ¶
func GetExecutor(resourceType, jobName string) (*NodeTaskExecutor, error)
GetExecutor returns the found executors from the nodeTaskExecutors, found by resource type and job name.
func NewNodeTaskExecutor ¶
func NewNodeTaskExecutor(ctx context.Context, job wrap.NodeJob, updateFun UpdateNodeTaskStatus, ) (*NodeTaskExecutor, bool, error)
NewNodeTaskExecutor create an executor and add to nodeTaskExecutors. If one already exists in nodeTaskExecutors, use it.
func (*NodeTaskExecutor) Execute ¶
func (executor *NodeTaskExecutor) Execute(ctx context.Context, connectedNodes []string)
Execute executes the node tasks. It uses a pool to control the number of concurrent executions of node tasks. The connectedNodes arg indicates the edge nodes that the current CloudCore is connected to. Only these nodes will execute tasks.
func (*NodeTaskExecutor) FinishTask ¶
func (executor *NodeTaskExecutor) FinishTask()
FinishTask when a node task has been completed, this function needs to be executed. Whether the node task is completed is sensed in the upstream.
func (*NodeTaskExecutor) Interrupt ¶
func (executor *NodeTaskExecutor) Interrupt()
Interrupt interrupts the executor