Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GenericTask ¶
type Task ¶
Task is the basic unit of tasker package, which represents an executable work.
Task at its core is nothing more than a synchronous function. Working with synchronous functions removes the complexity of thinking about how to run your application. Your components become more stateless and focus on the domain rather than the lifecycle management. This less stateful approach can help to make testing your Task also easier.
func Concurrence ¶
func Concurrence[TFN GenericTask](tfns ...TFN) Task
Concurrence is a construct that allows you to execute a list of Task concurrently. If any of the Task fails with an error, all Task will receive cancellation signal.
func Sequence ¶
func Sequence[TFN GenericTask](tfns ...TFN) Task
Sequence is a construct that allows you to execute a list of Task sequentially. If any of the Task fails with an error, it breaks the sequential execution and the error is returned.
func ToTask ¶
func ToTask[TFN GenericTask](tfn TFN) Task
func ToTasks ¶
func ToTasks[TFN GenericTask](tfns []TFN) []Task