I have a method called runClient
that is blocking, basically it never ends. My first instinct was to put it into a Thread, but I can't stop it because stop()
is deprecated, and I cannot check for an interrupt if the method is always blocking.
Is there some way to run it async, and then be able later to stop/destroy the execution of the method?