Menu
Introduction
Getting Started
Developer guide
Release
Architecture
CLI
Technical documentations
Version
Publication date

Mar 9, 2022

Confidentiality
Public
Reactions
1
Share

AppProcess

Process of an app. A process is an instance of a running command that serves a single app.

The app is served on local ports. A Nginx reverse proxy is used to expose the app on the host URL.

Functions
__init__

Initialize the app process.

Note: The app is not generated here. Generation happens on first start.

app : AppInstance
call_health_check

Call the health check of the app to check if it is still running

Return type : bool
count_connections
Return type : int
get_app_full_url

Get the full URL for the app with authentication tokens.

This method handles user authentication and generates access tokens.

Return type : AppInstanceUrl
get_current_user_theme
Return type : FrontTheme
get_host_name

Get the host name for the app process based on the port and suffix. This is used to generate the host URL for the app. We use the resource_model_id as host name to have a stable URL for the app. The stable URL is required for reflex as the backend url is stored in the front build and should not change at each deployment.

suffix : str - ''
Return type : str
get_host_url
suffix : str - ''
Return type : str
get_id
Return type : str
get_service_source_port
Return type : int
get_status

Get the current status of the app process

Return type : AppProcessStatus
get_status_dto
Return type : AppProcessStatusDTO
get_status_text

Get the current status text of the app process

Return type : str
get_token

Get the token of the app process. This is used to secure the app and allow access to it.

Return type : str
get_user_id_from_token

Get the user id from the user access token. If the user does not exist, return None.

user_access_token : str
The user access token
Return type : str | None
get_working_dir

Get the working directory for this app process.

The directory is created when the app is first started. Raises an exception if called before the app is generated.

Return type : str
is_running

Check if the app process is running

Return type : bool
is_starting

Check if the app process is starting

Return type : bool
is_stopped

Check if the app process is stopped

Return type : bool
set_status

Set the status and status text of the app process

status : AppProcessStatus
status_text : str - ''
start_app_async

Start the process for the app.

The app will be generated on first start if not already done.

start_check_running

Method to start the check running loop to check if the app is still used

stop_process

Kill the process and the app

subprocess_is_running
Return type : bool
user_has_access_to_app

Return the user id from the user access token if the user has access to the app.

user_access_token : str
The user access token
Return type : str | None
uses_port

Check if the process uses the given port

port : int
Return type : bool
wait_for_start

Wait for the process to start

Return type : AppProcessStatus
wait_main_app_health_check
Shine Logo
Technical bricks to reuse or customize

Have you developed a brick?

Share it to accelerate projects for the entire community.