diff --git a/internal/third/ants/ants.go b/internal/third/ants/ants.go index 8deeb5b..ad0d24f 100644 --- a/internal/third/ants/ants.go +++ b/internal/third/ants/ants.go @@ -122,7 +122,7 @@ type ( // Envelope is the underlying wrapper used for func based (with input) // worker pools. Envelope struct { - ID RoutineID + id RoutineID Input any state any } @@ -130,13 +130,13 @@ type ( // 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 { @@ -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 { diff --git a/internal/third/ants/worker-func.go b/internal/third/ants/worker-func.go index b5fc6c8..ac4c9fb 100644 --- a/internal/third/ants/worker-func.go +++ b/internal/third/ants/worker-func.go @@ -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, }: } diff --git a/internal/third/ants/worker.go b/internal/third/ants/worker.go index 859ac5a..be97d7b 100644 --- a/internal/third/ants/worker.go +++ b/internal/third/ants/worker.go @@ -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, }: }