moleculekit.viewer.molstar.server module#
Singleton HTTP server with SSE for the molstar viewer.
- class moleculekit.viewer.molstar.server.ServerState(port, session, httpd, server_thread, monitor_thread, registry, subscribers, subscribers_lock, stop_event)#
Bases:
object- httpd: ThreadingHTTPServer#
- monitor_thread: Thread#
- port: int#
- server_thread: Thread#
- session: str#
- stop_event: Event#
- subscribers: list[Queue]#
- subscribers_lock: allocate_lock#
- moleculekit.viewer.molstar.server.get_or_start_server(open_browser=True)#
Start the singleton server on first call; subsequent calls are no-ops.
- Return type:
- moleculekit.viewer.molstar.server.register(mol)#
Register a Molecule with the running server; returns its slot uuid.
- Return type:
str
- moleculekit.viewer.molstar.server.shutdown_for_tests()#
- Return type:
None
- moleculekit.viewer.molstar.server.start_for_tests(open_browser=False)#
- Return type: