AnswerDotAI / AnswerDotAI/fasthtml

[FEATURE] Allow JupyUvi in to run in daemon mode

Open
#870 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Jupyter Notebook
Stars
7k
Forks
319
Avg merge
28m
Merged PRs (30d)
3

Description

**Is your feature request related to a problem? Please describe.**
I am using `JupyUvi` inside notebooks for testing with `nbdev`. When a test fails in the middle of the notebook, `JupyUvi`'s `server.stop` is not called. Because the server runs the thread in non-daemon mode, the thread interrupts the process shutdown so`nbdev-test` hangs whenever something fails.

**Describe the solution you'd like**
I would like to be able to run the server in daemon mode. That way the parent process `nbdev-test` can kill it on exit after a brief wait. This *could* leave some open resources but given that the goal is to use it in notebook testing I feel it is acceptable. For "regular" use you can always run it in non-daemon mode to make sure it blocks before exiting.

**Example code**
Provide an example of how you imagine the feature working:

```python
srv = JupyUvi(daemon=True)
```

**Problem solved**

Process hanging due to missing `server.stop()`

**Confirmation**
Please confirm the following:
- [x] I have checked the existing issues and pull requests to ensure this feature hasn't been requested before.
- [x] I have read the project's documentation to ensure this feature doesn't already exist.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.