Skip to content

Commit

Permalink
fix(async): change the channel type on pool.Start (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
plastikfan committed Aug 30, 2023
1 parent b2e997d commit 0c0ec2b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions async/worker-pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ func (p *WorkerPool[I, O]) composeID() WorkerID {

func (p *WorkerPool[I, O]) Start(
ctx context.Context,
outputsChOut OutputStreamW[O],
outputsChOut OutputStream[O],
) {
p.run(ctx, p.private.workersJobsCh, outputsChOut)
}

func (p *WorkerPool[I, O]) run(
ctx context.Context,
forwardChOut JobStreamW[I],
outputsChOut OutputStreamW[O],
outputsChOut OutputStream[O],
) {
defer func() {
if outputsChOut != nil {
Expand Down Expand Up @@ -171,7 +171,7 @@ func (p *WorkerPool[I, O]) run(
func (p *WorkerPool[I, O]) spawn(
ctx context.Context,
jobsChIn JobStreamR[I],
outputsChOut OutputStreamW[O],
outputsChOut OutputStream[O],
finishedChOut FinishedStreamW,
) {
cancelCh := make(CancelStream, 1)
Expand Down
2 changes: 1 addition & 1 deletion async/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type worker[I any, O any] struct {
id WorkerID
exec ExecutiveFunc[I, O]
jobsChIn JobStreamR[I]
outputsChOut OutputStreamW[O]
outputsChOut OutputStream[O]
finishedChOut FinishedStreamW

// this might be better replaced with a broadcast mechanism such as sync.Cond
Expand Down

0 comments on commit 0c0ec2b

Please sign in to comment.