ReflexProcess
Object representing a running Reflex app process. This process runs the front and back of a Reflex app. In dev mode: runs 'reflex run'. In prod mode: builds frontend (served by nginx) and runs backend-only.
There is 1 ReflexProcess per app. If the same reflex app is runned multiple times, it will use the different processes. In prod the front build folder is stored in resource path.
back_port: intfront_port: intInitialize the app process.
Note: The app is not generated here. Generation happens on first start.
intintAppInstanceCall the health check of the app to check if it is still running
boolintGet the full URL for the app with authentication tokens.
This method handles user authentication and generates access tokens.
AppInstanceUrlstrFrontThemeGet 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.
str - ''strstr - ''strstrintGet the current status of the app process
AppProcessStatusAppProcessStatusDTOGet the current status text of the app process
strGet the token of the app process. This is used to secure the app and allow access to it.
strGet the user id from the user access token. If the user does not exist, return None.
strstr | NoneGet 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.
strCheck if the app process is running
boolCheck if the app process is starting
boolCheck if the app process is stopped
boolSet the status and status text of the app process
AppProcessStatusstr - ''Start the process for the app.
The app will be generated on first start if not already done.
Method to start the check running loop to check if the app is still used
Kill the process and the app
boolReturn the user id from the user access token if the user has access to the app.
strstr | NoneCheck if the process uses the given port
intboolWait for the process to start
AppProcessStatus