Gracefully exiting kernel when users closes UI page

How do you gracefully kill the current kernel when I close the UI web page? Currently, the kernel keeps running and I have to cntl-c to shut it down. From the documentation, it seems that I must shutdown the websocket. Please forgive my ignorance, but how does one go about doing that within solara? Or am I barking up the wrong tree?
5 Replies
MaartenBreddels
MaartenBreddels6mo ago
Do you want to stop the server once a tab is closed? Like an app that is only for a single time use?
Cold Sunshine
Cold SunshineOP6mo ago
Well, I guess for development purposes, this would make things easier, just shutting everything down by shutting down the page. In operations, I can see this is a stupid idea.
MaartenBreddels
MaartenBreddels6mo ago
For a command line utility it makes sense. Why do you want this for development? We have hot reload for app builders, and auto server restart for development on solara itself
Cold Sunshine
Cold SunshineOP6mo ago
Well, for now I must close the web page then do several control-c s to shut things down. I am just wondering if I could have an 'exit' button that would shut things down.
MaartenBreddels
MaartenBreddels6mo ago
Why do you need to shut it down? Not after code changes right?
Want results from more Discord servers?
Add your server