-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ExecutorService is not shut down #1
Comments
Yess i should add more examples. player. stop() where player is your instance. Before you exit the application :) You can also see the code of XR3Player which i have implemented everything and it is a JavaFX Media Player. Keep me notified. |
Hi and thanks for the quick reply :) calling stop alone doesn't do it for me: the process keeps running. init {
appCtl.exitHandler.add {
log.info("Exit handler")
stop()
getExecutorService("streamPlayerExecutorService").shutdownNow()
getExecutorService("eventsExecutorService").shutdownNow()
}
}
private fun getExecutorService(fieldname: String) =
StreamPlayer::class.java.getDeclaredField(fieldname).run {
isAccessible = true
get(streamPlayer) as ExecutorService
}
|
player. stop() doesn't work really? Like i am using it in my own app. How is that possible. Ah yes yes. You can exit your application with System.exit(-1) or 0 |
Executors shutdown isn't promising to terminate just the second you call it. |
Maybe some wants the thread to be automatically halted right after all other threads finished. If the two (is it correct?) threads were daemon it would be helpful, so maybe adding daemon-thread option is one way. |
Yes that's a good idea 💡. Hm i am thinking how to code it m |
First of all thanks for the work on this project - works wonderfully.
I used it in a JavaFX application and noticed, that after calling Platform.exit(), the process was still running.
It seems like the StreamPlayer class uses Java8 ExecutorService, but never shuts it down.
How about adding a public method to shut down the ExecutorServices ?
The text was updated successfully, but these errors were encountered: