Comments (1)
I may have figured out what was causing this. It looks like Panel is holding onto Panel resources even after the Python interpreter exits. Maybe a leak of some kind?
Anyways, I found that running pn.state.kill_all_servers()
as the last line in main.py eliminates all of the problems here. I also moved all of the variables to a def main
function so that there are zero global variables other than the app object. The weird thing with this is I am stopping the server. It shouldn't be running, unless the state is still left behind?
Why doesn't panel automatically do this clean up operation when Python exits? It's probably a good idea.
def main(app):
# Pybinding object.
launcher = AppLauncher(app)
launcher.run()
if __name__ == "__main__":
print("Creating C++ application")
app = cpp_app_test.Application()
print("C++ application created.")
main(app)
print("Exiting interpreter. Destructors should be called after this point!")
pn.state.kill_all_servers()
produces the output:
Creating C++ application
Constructed application.
C++ application created.
Launching server at http://0.0.0.0:5000
^CCaught signal 2, shutting down...
Delete main page
Exiting interpreter. Destructors should be called after this point!
Delete home page
Destroyed application
I've noticed that the full application which contains a Sidebar and a Controller still doesn't work though. I may just reduce the number of references to self_app
to fix this.
from panel.
Related Issues (20)
- Make label on the checkbox itself interactive
- Dynamically Adjusting Spacing in Panel MultiChoice Widget HOT 5
- Tabulator header_filter with multiselect enabled: AttributeError HOT 4
- 'katex' extension was not loaded
- pixi run test-example picks up old Panel code version HOT 7
- Fail test_textual.py due to recent textual._xterm_parser.XTermParser change HOT 2
- Flaky UI tests for ToggleIcon and Tabulator on MacOS HOT 4
- pixi run docs-build missing Webdriver HOT 6
- Mention JSComponent in Explanation/Components docs? HOT 7
- Docs issues to be fixed before 1.5.0 HOT 23
- ChatInterface prompt for user input method
- ReactiveHTML Param Watcher: Coroutine never awaited. HOT 2
- interface.serialize() should be able to pass prefix_with_viewable_label
- Can't use templates from Jupyter Notebook or JupyterLab HOT 2
- Jupyter Notebook does not reflect latest pn.pane.Bokeh plot
- global loading spinner static asset not available
- file_dropper extension not loaded, but no file_dropper extension after adding
- FileDropper accepted_filetypes doesn't seem to properly validate HOT 3
- Restructure ChatMessage UI layout? HOT 4
- Terminal widget set as `sys.stdout` does *not* write to terminal in synchronous functions and is delayed in appearing, using Jupyter notebook
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from panel.