diff --git a/worker.go b/worker.go index ed941b7..5b8426b 100644 --- a/worker.go +++ b/worker.go @@ -26,9 +26,9 @@ import ( "sync/atomic" ) -// Worker is the actual executor who run the tasks, -// it will start a goroutine that accept tasks and -// perform function calls. +// Worker is the actual executor who runs the tasks, +// it starts a goroutine that accepts tasks and +// performs function calls. type Worker struct { // pool who owns this worker. pool *Pool @@ -37,8 +37,8 @@ type Worker struct { task chan f } -// run will start a goroutine to repeat the process -// that perform the function calls. +// run starts a goroutine to repeat the process +// that performs the function calls. func (w *Worker) run() { //atomic.AddInt32(&w.pool.running, 1) go func() { @@ -58,7 +58,7 @@ func (w *Worker) stop() { w.task <- nil } -// sendTask send a task to this worker. +// sendTask sends a task to this worker. func (w *Worker) sendTask(task f) { w.task <- task } diff --git a/worker_func.go b/worker_func.go index 3d07f3d..b8d59ec 100644 --- a/worker_func.go +++ b/worker_func.go @@ -26,9 +26,9 @@ import ( "sync/atomic" ) -// Worker is the actual executor who run the tasks, -// it will start a goroutine that accept tasks and -// perform function calls. +// WorkerWithFunc is the actual executor who runs the tasks, +// it starts a goroutine that accepts tasks and +// performs function calls. type WorkerWithFunc struct { // pool who owns this worker. pool *PoolWithFunc @@ -37,8 +37,8 @@ type WorkerWithFunc struct { args chan interface{} } -// run will start a goroutine to repeat the process -// that perform the function calls. +// run starts a goroutine to repeat the process +// that performs the function calls. func (w *WorkerWithFunc) run() { //atomic.AddInt32(&w.pool.running, 1) go func() { @@ -58,7 +58,7 @@ func (w *WorkerWithFunc) stop() { w.args <- nil } -// sendTask send a task to this worker. +// sendTask sends a task to this worker. func (w *WorkerWithFunc) sendTask(args interface{}) { w.args <- args }