You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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()
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 thanfrom_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, likeTempTiledServer()
@genematx has a prototype over in https://github.com/bluesky/bluesky-cookbook/pull/24/files#diff-de29f45755c18a7cb50720ad79693f53741163f9236c5cf6eea33cdfb5dd0b64
The text was updated successfully, but these errors were encountered: