Skip to content

Add task chaining#5

Merged
kelindar merged 3 commits intomasterfrom
after
Jul 5, 2025
Merged

Add task chaining#5
kelindar merged 3 commits intomasterfrom
after

Conversation

@kelindar
Copy link
Owner

@kelindar kelindar commented Jul 5, 2025

This pull request introduces a new feature called "Task Chaining" to the library, enabling sequential execution of dependent tasks. It also includes updates to the documentation, benchmarks, and unit tests to support this feature. Additionally, minor adjustments were made to improve code clarity and consistency.

New Feature: Task Chaining

  • Implementation of Task Chaining: Added the After function in task.go to allow chaining tasks where the output of one task becomes the input of the next. Continuation functions are managed using atomic operations.
  • Support for Continuation Execution: Modified the run method in task.go to execute continuation functions automatically after the predecessor task completes.

Documentation Updates

  • Added Task Chaining Section: Updated README.md to include a new section explaining the concept of task chaining, its use cases, and an example of a processing pipeline.
  • Updated Feature List: Added "Task Chaining" to the list of supported concurrency patterns in README.md.

Unit Tests

  • Comprehensive Test Coverage: Added multiple unit tests in task_test.go to cover basic chaining, error handling, multiple chaining, cancellation, and chaining with completed tasks.

Benchmark Adjustments

  • Updated Benchmark Results: Refined benchmark data in bench_test.go to reflect performance characteristics after introducing task chaining.

@kelindar kelindar merged commit c56f5f2 into master Jul 5, 2025
2 checks passed
@kelindar kelindar deleted the after branch July 5, 2025 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant