Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions internal/third/ants/ants.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,21 +122,21 @@ type (
// Envelope is the underlying wrapper used for func based (with input)
// worker pools.
Envelope struct {
ID RoutineID
id RoutineID
Input any
state any
}

// TaskEnvelope is the underlying wrapper used for task based
// worker pools.
TaskEnvelope struct {
ID RoutineID
id RoutineID
Task TaskFunc
}
)

func (e Envelope) WorkerID() RoutineID {
return e.ID
return e.id
}

func (e Envelope) Param() InputParam {
Expand All @@ -148,7 +148,7 @@ func (e Envelope) State() any {
}

func (e TaskEnvelope) WorkerID() RoutineID {
return e.ID
return e.id
}

func (e TaskEnvelope) Func() TaskFunc {
Expand Down
2 changes: 1 addition & 1 deletion internal/third/ants/worker-func.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func (w *goWorkerWithFunc) sendParam(ctx context.Context, job InputParam) {
select {
case <-ctx.Done():
case w.inputCh <- &Envelope{
ID: w.id,
id: w.id,
Input: job,
}:
}
Expand Down
2 changes: 1 addition & 1 deletion internal/third/ants/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (w *goWorker) sendTask(ctx context.Context, fn TaskFunc) {
select {
case <-ctx.Done():
case w.taskCh <- &TaskEnvelope{
ID: w.id,
id: w.id,
Task: fn,
}:
}
Expand Down
Loading