Releases: kelindar/async
Task Chaining
This release introduces a task chaining to the library, enabling sequential execution of dependent operations where the output of one task becomes the input of the next. This pattern is essential for creating processing pipelines, implementing workflows, or building reactive systems where operations must happen in a specific order. The After function provides a clean, functional approach to task composition with automatic execution and result propagation.
// Create a processing pipeline
task1 := async.NewTask(func(ctx context.Context) (string, error) {
// Fetch raw data
return "raw data", nil
})
task2 := async.After(task1, func(ctx context.Context, data string) (string, error) {
// Process the raw data
return "processed: " + data, nil
})
task3 := async.After(task2, func(ctx context.Context, processed string) (string, error) {
// Final transformation
return "final: " + processed, nil
})
// Start the chain by running the first task
task1.Run(context.Background())
// Get the final result
result, err := task3.Outcome()
// result will be "final: processed: raw data"v1.3.1
v1.3.0
This release modernizes and streamlines the async library by introducing type safety with Go generics, eliminating legacy features (such as Batch and Partition), and enhancing documentation and CI/CD configurations. Key changes include the refactoring of core functions like Repeat, InvokeAll, and Consume to use generics, the removal of deprecated partition/fork-join and batch code, and significant improvements to testing, documentation, and dependency management.
What's Changed
Full Changelog: v1.2.0...v1.3.0