Commit Graph

49 Commits

Author SHA1 Message Date
Andy Pan 15e896153d
opt: make ReleaseTimeout() more efficient in waiting workers to exit (#329) 2024-06-18 01:06:48 +08:00
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 1d33782287 🐠 Adapt worker for explicit functions 2019-02-02 10:36:40 +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 3afa151dd9 simplify and optimize goroutine-worker 2018-07-15 00:52:18 +08:00
andy pan d04febc0b2 clear expired workers for Pool 2018-07-06 14:33:07 +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 6581f1821d update 2018-05-24 18:35:26 +08:00
Andy Pan 0453f88168 update 2018-05-23 00:46:43 +08:00
andy pan 4c08436194 format the some comments 2018-05-21 10:37:03 +08:00
Andy Pan 0244b2356f update MIT license info 2018-05-20 23:57:48 +08:00
Andy Pan 301221be5d add all comments 2018-05-20 21:09:45 +08:00
Andy Pan 2b0c0227b6 add the copyright of MIT license 2018-05-20 16:37:17 +08:00
Andy Pan 5b274e54b4 test 2018-05-20 11:51:14 +08:00
Andy Pan 798a61d175 optimize memory using 2018-05-20 03:35:31 +08:00
Andy Pan 91349c14bb use sync.Pool to recycle goroutines 2018-05-20 02:52:39 +08:00
Andy Pan a59f51fefd update 2018-05-20 01:38:50 +08:00
Andy Pan 0423264ffa use WaitGroup to wait all goroutines to exit 2018-05-19 19:51:33 +08:00
Andy Pan 0fd8ba8dae use the "container/list" to keep workers 2018-05-19 19:08:31 +08:00
Andy Pan 2929cede54 use sync.Pool 2018-05-19 18:24:36 +08:00
Andy Pan 8ff88950b8 add codes for reusing workers 2018-05-19 13:09:44 +08:00
Andy Pan b7b2b27596 reuse workers 2018-05-19 12:57:01 +08:00
Andy Pan 7bf85c2a66 optimize worker queue 2018-05-19 12:36:28 +08:00
Andy Pan c7cac2be5f init proj 2018-05-19 12:28:03 +08:00