FletApp
Inherits: Connection
Handle Flet app WebSocket connections.
Parameters:
-
loop(AbstractEventLoop) –asyncioevent loop (asyncio.get_running_loop()). -
executor(ThreadPoolExecutor) –Thread pool executor (
app_manager.executor). -
main(Callable[[Any], Any]) –Application entry point - an async method called for newly connected user. Handler coroutine must have 1 parameter of instance
Page. -
before_main(Callable[[Any], Any] | None) –Called before
main. -
session_timeout_seconds(int, default:DEFAULT_FLET_SESSION_TIMEOUT) –Session lifetime, in seconds, after user disconnected.
-
oauth_state_timeout_seconds(int, default:DEFAULT_FLET_OAUTH_STATE_TIMEOUT) –OAuth state lifetime, in seconds, which is a maximum allowed time between starting OAuth flow and redirecting to OAuth callback URL.
-
upload_endpoint_path(str | None, default:None) –Absolute URL of upload endpoint, e.g.
/upload. -
secret_key(str | None, default:None) –Secret key to sign upload requests.
Properties
Methods
-
dispose–Release app-level session reference during teardown.
-
get_upload_url–Build signed upload URL for a file.
-
handle–Handle WebSocket connection.
-
oauth_authorize–Persist OAuth state metadata for a pending authorization flow.
-
send_message–Serialize and enqueue a server message for transport to the client.
Properties#
Methods#
get_upload_url
#
Build signed upload URL for a file.
Parameters:
Returns:
-
str–Signed relative upload URL.
Raises:
-
RuntimeError–If upload endpoint is not configured.
oauth_authorize
#
send_message
#
Serialize and enqueue a server message for transport to the client.
Parameters:
-
message(ClientMessage) –Outbound protocol message.