AppHandle
Protocol defining the common interface between local and remote app handles.
Attributes
| Attribute | Type | Description |
|---|---|---|
| name | str | The unique identifier of the application used for referencing it within the serving environment. |
| url | str | The base URL where the application is hosted and accessible for network requests. |
| endpoint | str | The specific entry point or API path used to interact with the application's primary functionality. |
Methods
name()
@classmethod
def name() - > str
The unique identifier or display name of the application instance.
Returns
| Type | Description |
|---|---|
str | The string name of the app. |
url()
@classmethod
def url() - > str
The base URL where the application is currently hosted or accessible.
Returns
| Type | Description |
|---|---|
str | The full URL string for the application. |
endpoint()
@classmethod
def endpoint() - > str
The specific network endpoint or address used for communicating with the application.
Returns
| Type | Description |
|---|---|
str | The endpoint address string. |
is_active()
@classmethod
def is_active() - > bool
Checks whether the application is currently running and ready to handle requests.
Returns
| Type | Description |
|---|---|
bool | True if the app is active, False otherwise. |
is_deactivated()
@classmethod
def is_deactivated() - > bool
Checks whether the application has been shut down or moved to a deactivated state.
Returns
| Type | Description |
|---|---|
bool | True if the app is deactivated, False otherwise. |
activate()
@classmethod
def activate(
wait: bool = False
) - > [AppHandle](apphandle.md?sid=flyte__serve_apphandle)
Transitions the application to an active state to begin serving traffic.
Parameters
| Name | Type | Description |
|---|---|---|
| wait | bool = False | Whether to block execution until the application has fully finished its activation sequence. |
Returns
| Type | Description |
|---|---|
[AppHandle](apphandle.md?sid=flyte__serve_apphandle) | The AppHandle instance for chaining calls. |
deactivate()
@classmethod
def deactivate(
wait: bool = False
) - > [AppHandle](apphandle.md?sid=flyte__serve_apphandle)
Transitions the application to a deactivated state and stops serving traffic.
Parameters
| Name | Type | Description |
|---|---|---|
| wait | bool = False | Whether to block execution until the application has fully finished its deactivation sequence. |
Returns
| Type | Description |
|---|---|
[AppHandle](apphandle.md?sid=flyte__serve_apphandle) | The AppHandle instance for chaining calls. |
ephemeral_ctx()
@classmethod
def ephemeral_ctx() - > AbstractAsyncContextManager[None]
Provides an asynchronous context manager that activates the app on entry and deactivates it on exit.
Returns
| Type | Description |
|---|---|
AbstractAsyncContextManager[None] | An async context manager for managing the app lifecycle. |
ephemeral_ctx_sync()
@classmethod
def ephemeral_ctx_sync() - > AbstractContextManager[None]
Provides a synchronous context manager that activates the app on entry and deactivates it on exit.
Returns
| Type | Description |
|---|---|
AbstractContextManager[None] | A context manager for managing the app lifecycle in synchronous code. |