Closed daniel-hutao closed 1 year ago
executeTaskWithTimeout
worker.go
Wait
gopool.go
TestGoPoolWithTimeout
gopool_test.go
lock
goPool
workerStack
popWorker
fix #6
executeTaskWithTimeout
function inworker.go
to stop the task when the context is cancelled.Wait
function ingopool.go
to wait until all tasks are completed, not just dispatched.TestGoPoolWithTimeout
ingopool_test.go
to test the behavior of goPool when a task times out.lock
field ingoPool
to protect concurrent access toworkerStack
inWait
andpopWorker
functions.fix #6