Skip to content

Remove Task type with pool now calling Do directly#2

Merged
alesr merged 2 commits into
mainfrom
remove-task-type-call-do-directly
May 12, 2026
Merged

Remove Task type with pool now calling Do directly#2
alesr merged 2 commits into
mainfrom
remove-task-type-call-do-directly

Conversation

@alesr
Copy link
Copy Markdown
Owner

@alesr alesr commented May 12, 2026

The Task[T] struct and its Fn func(T) field were a design inconsistency. the Input interface constraint required every type to implement Do(context.Context), but the pool never called it.

Instead, we were only using it as a generic constraint and users had to wrap their Do call inside a redundant Fn closure, making the API annoying to use.

This PR fixes that by removing Task[T] entirely. The pool now calls input.Do(ctx) directly, so the Input constraint is fully honoured.

@alesr alesr self-assigned this May 12, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.07%. Comparing base (99d863e) to head (62e7fbe).

Additional details and impacted files
@@            Coverage Diff             @@
##             main       #2      +/-   ##
==========================================
+ Coverage   86.27%   96.07%   +9.80%     
==========================================
  Files           1        1              
  Lines          51       51              
==========================================
+ Hits           44       49       +5     
+ Misses          6        2       -4     
+ Partials        1        0       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alesr alesr merged commit 36156ae into main May 12, 2026
7 checks passed
@alesr alesr deleted the remove-task-type-call-do-directly branch May 12, 2026 19:54
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