Module h2o_wave.server
Functions
app
Indicate that a function is a query handler.
The function this decorator is applied to must accept exactly one argument that represents the query context, of type Query or Query
Args
route- The route to listen to. e.g.
'/foo'or'/foo/bar/baz'. mode- The server mode. One of
'unicast'(default),'multicast'or'broadcast'. on_startup- A callback to invoke on app startup. Callbacks do not take any arguments, and may be be either standard functions, or async functions.
on_shutdown- A callback to invoke on app shutdown. Callbacks do not take any arguments, and may be be either standard functions, or async functions.
Classes
Auth
Represents authentication information for a given query context. Carries valid information only if single sign on is enabled.
Instance variables
The access token of the user.
The refresh token of the user.
A unique identifier for the user.
The username of the user.
Methods
ensure_fresh_token
Explicitly refresh OIDC tokens when needed, e.g. during long-running background jobs.
ensure_fresh_token_sync
Explicitly refresh OIDC tokens when needed, e.g. during long-running background jobs - synchronous version. Prefer async version. Use sync only when absolutely necessary - will block your app, making it slow for all users.
Query
Represents the query context. The query context is passed to the @app handler function whenever a query arrives from the browser (page load, user interaction events, etc.). The query context contains useful information about the query, including argumentsargs (equivalent to URL query strings) and app-level, user-level and client-level state.
Instance variables
A Expando instance to hold application-specific state.
A Expando instance containing arguments from the active request.
The authentication / authorization details of the user who initiated this query.
An Expando instance to hold client-specific state.
A Expando instance containing events from the active request.
Original Websocket HTTP connection headers forwarded from the Wave server to this application.
The server mode. One of 'unicast' (default),'multicast' or 'broadcast'.
A reference to the current page.
The route served by the server.
A reference to the current site.
A Expando instance to hold user-specific state.
Methods
exec
Execute a function in the background using the specified executor.
To execute a function in-process, use q.run().
Args
executor- The executor to be used. If None, executes the function in-process.
func- The function to to be called.
args- Arguments to be passed to the function.
kwargs- Keywords arguments to be passed to the function.
Returns
The result of the function call.
run
Q
Represents the query context. The query context is passed to the @app handler function whenever a query arrives from the browser (page load, user interaction events, etc.). The query context contains useful information about the query, including argumentsargs (equivalent to URL query strings) and app-level, user-level and client-level state.
Instance variables
A Expando instance to hold application-specific state.
A Expando instance containing arguments from the active request.
The authentication / authorization details of the user who initiated this query.
An Expando instance to hold client-specific state.
A Expando instance containing events from the active request.
Original Websocket HTTP connection headers forwarded from the Wave server to this application.
The server mode. One of 'unicast' (default),'multicast' or 'broadcast'.
A reference to the current page.
The route served by the server.
A reference to the current site.
A Expando instance to hold user-specific state.
Methods
exec
Execute a function in the background using the specified executor.
To execute a function in-process, use q.run().
Args
executor- The executor to be used. If None, executes the function in-process.
func- The function to to be called.
args- Arguments to be passed to the function.
kwargs- Keywords arguments to be passed to the function.
Returns
The result of the function call.