-
Notifications
You must be signed in to change notification settings - Fork 419
Description
If you post to a threadpool that is in shutdown?
state, your work does not get executed and the call returns false
.
What I would have expected instead, is following whatever is the pool's overflow_policy
-- raise an exception for :abort, run in caller thread for :caller_runs, and only return without complaining (maybe returning false
, sure) for :discard
.
But is the present behavior what the java.util.concurrent stuff does? Maybe they have some reason for it, I guess, and I understand wanting to stay consistent. But following the overflow_policy
seems more useful and expected to me.
It is surprising to me to have to check the return value of #post to know if the work is actually going to be done, I'd expect an RejectedExcecution exception by default if posting to a shutdown pool (and since overflow_policy is abort by default, that's what I'd get if it followed overflow policy)