gws_core

Introduction
Getting Started
Developer guide
Release
Architecture
CLI
Technical documentations
Version

AppProcess

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

A process can have multiple apps running in it.

The apps are served on local ports. A Nginx reverse proxy is used to expose the apps on the host URL.All the apps are externally exposed to the same port, but depending on the sub domain, the local reverse proxy will redirect the request to the correct app.

Attributes
current_running_apps: Dictenv_hash: strid: stris_dev_mode: bool
Functions
__init__

Initialize self. See help(type(self)) for accurate signature.

id_ : str
env_hash : str
add_app_if_not_exists

Add an app to the process.

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
find_app_by_resource_model_id

Find the app that was generated from the given resource model id

resource_model_id : str
Return type : gws_core.apps.app_instance.AppInstance | None
get_and_check_app

Get the app instance and check if it exists

app_id : str
Return type : AppInstance
get_app
app_id : str
Return type : gws_core.apps.app_instance.AppInstance | None
get_app_full_url
app_id : str
Return type : AppInstanceUrl
get_cloud_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.

suffix : str - ''
Return type : str
get_current_user_theme
Return type : FrontTheme
get_host_url
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_working_dir
Return type : str
has_app
app_id : str
Return type : bool
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 using app_id

app_id : str
start_check_running

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

stop_process

Kill the process and all apps

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

app_id : str
user_access_token : str
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