graph LR
StreamlitEndpoints["StreamlitEndpoints"]
DefaultStreamlitEndpoints["DefaultStreamlitEndpoints"]
FileUploadClient["FileUploadClient"]
HostCommunicationManager["HostCommunicationManager"]
SessionInfo["SessionInfo"]
Streamlit_Backend_Server["Streamlit Backend Server"]
Embedding_Host_Environment["Embedding Host Environment"]
DefaultStreamlitEndpoints -- "implements" --> StreamlitEndpoints
DefaultStreamlitEndpoints -- "communicates with" --> Streamlit_Backend_Server
FileUploadClient -- "depends on" --> SessionInfo
FileUploadClient -- "interacts with" --> Streamlit_Backend_Server
HostCommunicationManager -- "communicates with" --> Embedding_Host_Environment
The Streamlit Frontend Communication subsystem is designed to facilitate robust and secure interaction between the client-side application and the Streamlit backend, as well as external embedding environments. At its core, the StreamlitEndpoints interface defines the contract for all backend communication, with DefaultStreamlitEndpoints providing the concrete, secure WebSocket implementation. File uploads are handled by FileUploadClient, which leverages SessionInfo for context. For embedded scenarios, HostCommunicationManager ensures seamless communication with the embedding host. This architecture ensures a clear separation of concerns, enabling efficient and reliable data exchange and application lifecycle management.
Defines the abstract interface for all general client-side communication with the Streamlit backend. This includes establishing and maintaining WebSocket connections and handling core application messages, serving as the primary contract for frontend-backend interaction.
Related Classes/Methods:
Provides the concrete implementation for StreamlitEndpoints. It manages the low-level details of secure, authenticated, and reliable WebSocket communication with the Streamlit server, handling message serialization/deserialization and the connection lifecycle.
Related Classes/Methods:
Manages the client-side logic for uploading user files to the Streamlit backend and handling file deletion requests. It orchestrates the file transfer process and integrates with session-specific information to ensure correct file association.
Related Classes/Methods:
Facilitates secure and structured communication between the Streamlit frontend and an embedding host environment. It manages messages related to embedding scenarios, such as resizing, theme changes, or external events, enabling Streamlit applications to function seamlessly within other web pages.
Related Classes/Methods:
Provides access to current session-specific details and configuration, such as the session ID, script run ID, and other contextual information necessary for various client-side operations, particularly for associating file uploads and other communications with the correct user session.
Related Classes/Methods:
The server-side component of Streamlit responsible for processing application logic, managing sessions, and serving data to the frontend.
Related Classes/Methods: None
An external web application or environment in which a Streamlit application is embedded, communicating with the Streamlit frontend for interactive features and display adjustments.
Related Classes/Methods: None