scala - Stop Application -


i have main function used play.core.server.prodserverstart start application. 1 know how stop server or let main exit gracefully? using play 2.4. thanks!

here main function:

object test {   def main (args: array[string]) {     play.core.server.prodserverstart.main(array())     println("main in test")     println("main finishes, want exit")     // how stop?   } } 

play.core.server.prodserverstart.main(array()) returns object of type serverwithstop (source). try assigning result variable server, calling server.stop():

object test {   def main (args: array[string]) {     val server = play.core.server.prodserverstart.main(array())     println("main in test")     println("main finishes, want exit")     server.stop()   } } 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -