py4j
py4j copied to clipboard
Give py4j threads explicit names, mark them as daemon
This PR makes py4j give more explicit names to the threads it creates (like py4j-… rather than the default Thread-…), which makes it easier to inspect JVM processes where py4j is running.
It also marks those threads as daemon, so that exiting the main thread of the JVM, by reaching the end of the main method, actually makes the JVM exit (provided no other non-daemon threads were created by users).
I didn't go as far as allowing py4j users to provide their own ThreadFactory, but I guess that would be the next step. That would allow users to more finely manage py4j threads if they need to.
oh yeah, probably it's a good idea to name them