Commit Graph

35 Commits

Author SHA1 Message Date
Andy Pan 55e222d20f chore: rename the method 'when' of worker to 'lastUsedTime' 2023-03-23 15:19:35 +08:00
Andy Pan e425c7b917 chore: rename the field 'recycleTime' of worker to 'lastUsed' 2023-03-23 15:18:56 +08:00
Andy Pan 7a56a5c082 opt: use runtime/debug.Stack() to print stack trace of panic 2023-03-23 14:42:17 +08:00
Andy Pan 0313effc53 opt: refactor the worker queue for reusability and readability of code 2023-03-23 12:28:47 +08:00
Andy Pan 9310acdff2 feat: implement pool.Waiting() API
Fixes #157
2022-05-07 22:43:25 +08:00
Zhening Li f62e8ab1e0
style: fixed some typos in the comments (#184)
* style: fixed some typos in the comments

* style: add space between en and zh words

Co-authored-by: Zhening <18501262663@163.com>
2021-09-13 11:57:25 +08:00
Andy Pan dbcb6a104f Fix an issue that blocks all waiting callers when all workers panic
Fixes #146 #147
2021-03-28 22:37:56 +08:00
Andy Pan e507ae340f Support customized logger 2020-03-13 00:02:19 +08:00
Andy Pan 8cbfb5dd67 Optimize the logic when putting worker back to sync.Pool 2019-10-14 02:50:13 +08:00
Andy Pan 5ecbdf4bf2 Make optimization to Pool and PoolWithFunc struct 2019-10-10 22:28:21 +08:00
Cholerae Hu d6cd5a7e72 worker: decRunning when revertWorker is false
Signed-off-by: Cholerae Hu <choleraehyq@gmail.com>
2019-09-12 09:00:31 +08:00
Andy Pan 201ac20358 Add functional options pattern for ants 2019-08-25 14:14:18 +08:00
Andy Pan 61c6b5a7b0 🍜slightly revise 2019-07-27 12:02:21 +08:00
anteoy 3e1c7a03a5 optimize memory allocation and add the log of panic stack 2019-07-26 23:22:24 +08:00
Andy Pan 00294fd50b 😏 Optimization of the structure and style 2019-04-14 11:08:06 +08:00
Andy Pan aa7dd6f8cc 🦖 Develop a more graceful release 2019-04-14 11:08:06 +08:00
Andy Pan 30bf38e6a8 🐝 Performance improvement: use sync.Pool to cache active workers 2019-01-27 00:25:47 +08:00
Andy Pan 90f672b9d5 update 2019-01-26 21:45:49 +08:00
Andy Pan 24c28c985c 🌎 Reduce blank lines 2019-01-25 22:00:33 +08:00
Cholerae Hu 9158bd3702 feature: add PanicHandler
Signed-off-by: Cholerae Hu <choleraehyq@gmail.com>
2019-01-22 13:41:33 +08:00
Andy Pan 1444008b67 rename methods 2018-08-03 19:28:46 +08:00
andy pan 042109890a make some methods unexported 2018-07-31 11:03:41 +08:00
barryz 83042d7095 pre-allocate the capacity of the worker list 2018-07-25 22:28:11 +08:00
Andy Pan eaf79d239f fixed some issues 2018-07-16 01:21:23 +08:00
Andy Pan 813cc218fe simplify and optimize goroutine-worker 2018-07-15 00:52:27 +08:00
andy pan 337c644550 add expired time for PoolWithFunc 2018-07-06 14:39:24 +08:00
andy pan d56ebb1a29 finish the ReSize() and Release() methods 2018-05-30 12:57:20 +08:00
andy pan 92a7dec196 optimization 2018-05-30 12:37:13 +08:00
Andy Pan 4b806f461b change some comments 2018-05-25 00:43:53 +08:00
andy pan 07f98b4ac6 remove some comments 2018-05-24 19:30:18 +08:00
andy pan ab6390f6d0 optimization 2018-05-24 19:27:54 +08:00
andy pan ff4b7d8a22 update 2018-05-24 18:30:58 +08:00
Andy Pan 0453f88168 update 2018-05-23 00:46:43 +08:00
Andy Pan 967b0b04e2 optimization 2018-05-22 12:01:00 +08:00
Andy Pan fad443d7d8 add a new type of pool, allowing to create a pool with a function 2018-05-22 11:26:16 +08:00