Skip to content

Commit 38a5b87

Browse files
author
ariel.pineiro
committed
fix
1 parent 796e211 commit 38a5b87

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

task/taskbuilder.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ type Task struct {
1212
Err error
1313
}
1414

15-
type Concurrent struct {
15+
type Awaitable struct {
1616
list list.List
1717
wg sync.WaitGroup
1818
taskBuilder *Builder
1919
}
2020

21-
func Await[T any](c *Concurrent, f func() (T, error)) *Task {
21+
func Await[T any](c *Awaitable, f func() (T, error)) *Task {
2222
fr := new(Task)
2323

2424
future := func() {
@@ -36,8 +36,8 @@ func Await[T any](c *Concurrent, f func() (T, error)) *Task {
3636
type Builder struct {
3737
}
3838

39-
func (tb *Builder) ForkJoin(f func(*Concurrent)) {
40-
c := new(Concurrent)
39+
func (tb *Builder) ForkJoin(f func(*Awaitable)) {
40+
c := new(Awaitable)
4141
c.taskBuilder = tb
4242

4343
f(c)

task/taskbuilder_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ func TestBuilder_ForkJoin(t *testing.T) {
1212

1313
tb := &task.Builder{}
1414

15-
tb.ForkJoin(func(c *task.Concurrent) {
15+
tb.ForkJoin(func(c *task.Awaitable) {
1616
future1 = task.Await[int](c, func() (int, error) { return 1, nil })
1717
future2 = task.Await[int](c, func() (int, error) { return 1, nil })
1818
})

0 commit comments

Comments
 (0)