Documentation ¶
Index ¶
- type Priority
- type Task
- func (t *Task) AddDependency(dependency *Task)
- func (t *Task) Cancel()
- func (t *Task) Dependencies() []*Task
- func (t *Task) Execute(ctx context.Context) error
- func (t *Task) ID() string
- func (t *Task) IsReady() bool
- func (t *Task) Priority() Priority
- func (t *Task) RemoveDependency(dependency *Task)
- func (t *Task) SetPriority(priority Priority)
- func (t *Task) Wait(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Task ¶
type Task struct {
// contains filtered or unexported fields
}
Task represents a unit of work that can be executed concurrently.
func (*Task) AddDependency ¶
AddDependency adds a dependency to the task.
func (*Task) Cancel ¶
func (t *Task) Cancel()
Cancel stops the task's execution if it's currently running.
func (*Task) Dependencies ¶
Dependencies returns the task's dependencies.
func (*Task) IsReady ¶
IsReady returns true if the task has no dependencies or all of its dependencies have completed execution.
func (*Task) RemoveDependency ¶
RemoveDependency removes a dependency from the task.
func (*Task) SetPriority ¶
SetPriority sets the task's priority level.
Click to show internal directories.
Click to hide internal directories.