streamlit.bootstrap
run
Run a script in a separate thread and start a server for the app
スクリプト (file引数で指定) は別のスレッドで動かす
サーバを起動する
別スレッドで動かすために
_fix_sys_path(script_path)
sys.path.insert(0, os.path.dirname(script_path))
script_pathを sys.path に追加
_set_up_signal_handler
SIGTERM等での停止のハンドリング
https://docs.python.org/ja/3/library/signal.html
サーバ起動
tornado.ioloop
https://www.tornadoweb.org/en/stable/ioloop.html
An I/O event loop for non-blocking sockets
In Tornado 6.0, IOLoop is a wrapper around the asyncio event loop, with a slightly different interface for historical reasons.
server = Server(ioloop, script_path, command_line)
ioloop(イベントループ)と スクリプト、コマンドラインを渡す
→ streamlit.server.server.Server
server.start()
callableを渡す
server.add_preheated_report_session()
スクリプトに関係
→ streamlit.server.server.Server