Skip to content

Commit e36bd01

Browse files
committed
Add comments
1 parent 567ba48 commit e36bd01

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

worker/pool.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ func (workerPoolSelf *DefaultWorkerPool) generateWorkerWithMaximum(maximum int)
223223
}()
224224
}
225225

226-
// SetJobQueue Set the JobQueue
226+
// SetJobQueue Set the JobQueue(WARNING: if the pool has started to use, doing this is not safe)
227227
func (workerPoolSelf *DefaultWorkerPool) SetJobQueue(jobQueue *fpgo.BufferedChannelQueue[func()]) *DefaultWorkerPool {
228228
workerPoolSelf.jobQueue = jobQueue
229229
return workerPoolSelf
@@ -235,13 +235,13 @@ func (workerPoolSelf *DefaultWorkerPool) SetIsJobQueueClosedWhenClose(isJobQueue
235235
return workerPoolSelf
236236
}
237237

238-
// SetPanicHandler Set the panicHandler
238+
// SetPanicHandler Set the panicHandler(handle/log panic inside workers)
239239
func (workerPoolSelf *DefaultWorkerPool) SetPanicHandler(panicHandler func(interface{})) *DefaultWorkerPool {
240240
workerPoolSelf.panicHandler = panicHandler
241241
return workerPoolSelf
242242
}
243243

244-
// SetWorkerBatchSize Set the workerBatchSize
244+
// SetWorkerBatchSize Set the workerBatchSize(queued jobs number that every worker could have)
245245
func (workerPoolSelf *DefaultWorkerPool) SetWorkerBatchSize(workerBatchSize int) *DefaultWorkerPool {
246246
workerPoolSelf.workerBatchSize = workerBatchSize
247247
workerPoolSelf.notifyWorkers()

0 commit comments

Comments
 (0)