From a6a76fa753f457b9c1c6bde288c97bc66a6bbe9b Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Thu, 31 Jan 2019 23:58:38 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=92=20Comments=20Enrichment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ants.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ants.go b/ants.go index 5d43db0..cb0cb95 100644 --- a/ants.go +++ b/ants.go @@ -38,7 +38,7 @@ const ( var ( // Error types for the Ants API. - + //--------------------------------------------------------------------------- // ErrInvalidPoolSize will be returned when setting a negative number as pool capacity. ErrInvalidPoolSize = errors.New("invalid size for pool") @@ -47,10 +47,10 @@ var ( // ErrPoolClosed will be returned when submitting task to a closed pool. ErrPoolClosed = errors.New("this pool has been closed") + //--------------------------------------------------------------------------- // workerChanCap determines whether the channel of a worker should be a buffered channel - // to get the best performance, inspired by fasthttp. - // https://github.com/valyala/fasthttp/blob/master/workerpool.go#L139 + // to get the best performance. Inspired by fasthttp at https://github.com/valyala/fasthttp/blob/master/workerpool.go#L139 workerChanCap = func() int { // Use blocking workerChan if GOMAXPROCS=1. // This immediately switches Serve to WorkerFunc, which results