質問

I am currently modifying an application to use a ScheduledExecutorService in place of a Timer and I don't know what to do with my old Timer.purge().

How are things handled with an Executor? Do I have to worry about anything?

役に立ちましたか?

解決

There is no equivalent for the Executor. When tasks are cancelled their reference will be removed from the Executor.

However the lifecycle of the Executor is managed with shutdown() so you should call that when the Executor is no longer required.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top