Can I restart an ExecutorService
to start accepting new task after it has been shutdown?
Or I have to always create new ExecutorService
instance?
If you look at the documentation, there is no method to restart an ExecutorService
, as it is an interface without such a method you can infer that there is no way to restart it. That said, as ExecutorService
is an interface, you could conceivably write an implementation that does restart (but you would have to reference it by its concrete type or another interface). I wouldn't recommend it though. Just use the existing ones and recreate them as necessary.
I don't see any indication that you can do that from the documentation.
What is the problem with creating new ones?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With