Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Utility for launching tiled server in background for tutorials #826

Open
danielballan opened this issue Dec 12, 2024 · 1 comment
Open

Comments

@danielballan
Copy link
Member

For development or production use of tiled, it is best to run a tiled server in its own process, using the CLI or a container.

But for tutorials and quick demos, it is convenient to launch a tiled server in the same process, such as from a Jupyter notebook. Otherwise, the user has to switch contexts, open a terminal, paste in some code...it breaks the flow. Requiring a separately-run server process also does not play well with Jupyter notebook publication workflows.

The server could be run as a subprocess or a thread. My gut feeling is that thread is the better option, because we may find reasons to want to interact with the server and this will be much simpler if it lives in-process.

On a thread, it could communicate via ASGI (passing HTTP messages in Python) or via TCP. Here, I think TCP is better because the client workflow will be more realistic, more similar to connecting to a normal Tiled server. That is, from_uri(...) rather than from_context(Context.from_app(app)).

My main concern is that this will be overused, applied in contexts beyond a tutorial. To that end, I think it should use temporary files only, and it should be minimally configurable---perhaps not at all configurable. Perhaps it should also have Temp in the name, like TempTiledServer()

@genematx has a prototype over in https://github.com/bluesky/bluesky-cookbook/pull/24/files#diff-de29f45755c18a7cb50720ad79693f53741163f9236c5cf6eea33cdfb5dd0b64

@genematx
Copy link
Contributor

Further discussion: bluesky/bluesky-cookbook#24 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants