Re: [Py4j-users] Starting/stopping py4j server from within python?
Status: Beta
Brought to you by:
barthe
From: Barthelemy D. <bar...@in...> - 2014-12-08 21:09:20
|
Hi, it depends on your use case. Most of the examples start a server in the Java main method so if you do gateway.shutdown() on the Python side, it will (1) send a shutdown signal on the Java side, (2) the Java server will stops, and (3) because there are no more active threads, the JVM will exit. You can even do something harsher from Python: gateway.jvm.System.exit(0) Does that help? Barthelemy On Mon, Dec 8, 2014 at 3:46 PM, Thomas Nyberg <tom...@gm...> wrote: > Hello, > > What would be the best way for me to start and stop the py4j server from > within python? I know I could use > > > os.system("java ...") > > to start the server. I guess I would need a subprocess for that not to > block. Then to stop it I could send it a kill signal. Is this the best > way to do it? Is there a way for me to do this in a less > directly-managed fashion? This is okay for me, but the users of what I'm > making probably would have trouble... > > Cheers, > Thomas > > ------------------------------------------------------------------------------ > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk > _______________________________________________ > Py4j-users mailing list > Py4...@li... > https://lists.sourceforge.net/lists/listinfo/py4j-users |