-
Initial workers automatically start running on pool initialization
- deprecated StartWorkers()
-
Each new added worker is being automatically started
-
SafeWaitUntilNSuccesses: it waits until n tasks were successfully processed, but if any extra task is already "in progress", this function will wait until it is done. An extra enqueued task could started processing just before the nth expected task was finished.
-
GetTotalWorkersInProgress: returns total workers in progress.
-
KillAllWorkers returns error
-
KillAllWorkersAndWait returns error
-
SetTotalWorkers It won't return error because of the workers were not yet started, workers are now started once they are created.
-
WaitUntilInitialWorkersAreUp: it waits until all initial workers are up and running.
-
StartWorkers is deprecated. It only returns nil.
-
StartWorkersAndWait is deprecated. It returns WaitUntilInitialWorkersAreUp()
- Examples: Replaced pool.StartWorkers() by pool.StartWorkersAndWait()
- Added optional channel to let know that new workers were started
- Enqueue jobs plus callback functions
- Enqueue callback functions without jobs' data
- Fixed bug that caused randomly worker initialization error
- SetTotalWorkers() returns error in case it is invoked before StartWorkers()
- Fixed bug that prevents to start/add new workers after a Wait() function finishes.
- LateKillAllWorkers() will kill all alive workers (not only the number of workers that were alive when the function was invoked)
- Repository name modified to "goworkerpool"
- Pause / Resume all workers:
- PauseAllWorkers()
- ResumeAllWorkers()
- Workers will listen to higher priority channels first
- Workers will listen to broad messages (kill all workers, ...) before get signals from any other channel:
- KillAllWorkers()
- KillAllWorkersAndWait()
- Added function to kill all workers (send a broad message to all workers) and wait until it happens:
- pool.KillAllWorkersAndWait()
- Added code examples
- Make Wait() listen to a channel (instead of use an endless for loop)
- Sync actions over workers. A FIFO queue was created for the following actions:
- Add new worker
- Kill worker(s)
- Late kill worker(s)
- Set total workers
- Added function to adjust number of live workers:
- pool.SetTotalWorkers(n)
- Added function to kill all live workers after current jobs get processed:
- pool.LateKillAllWorkers()
- readme.md
- godoc
- code comments
First stable BETA version.