简体   繁体   中英

how to know when a worker panic in golang ants

I am using ants as my goroutine pool in my program. This library handles panics of workers itself and won't propagate the panic, but I want to catch the panic whenever it occurs in one of my workers.

Is there any way to do this using ants or is there any other library to replace it with?

As I investigated more, I realized that I can define and use my own panic handler . It should be passed to the New function when you are creating an ants pool.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM