AppHandle
Protocol defining the common interface between local and remote app handles.
Attributes
| Attribute | Type | Description |
|---|---|---|
| name | str | Unique name identifying the application. |
| url | str | Network URL used to access the running application. |
| endpoint | str | Endpoint address used for interacting with the application. |
Methods
name()
@classmethod
def name() -> str
Retrieves the name of the application handle.
Returns
| Type | Description |
|---|---|
str | The unique name identifying the application. |
url()
@classmethod
def url() -> str
Retrieves the base URL for the serving application.
Returns
| Type | Description |
|---|---|
str | The URL where the application is accessible. |
endpoint()
@classmethod
def endpoint() -> str
Retrieves the endpoint path or identifier for the application.
Returns
| Type | Description |
|---|---|
str | The endpoint string used to route requests to the application. |
is_active()
@classmethod
def is_active() -> bool
Checks whether the application is currently active and running.
Returns
| Type | Description |
|---|---|
bool | True if the application is currently active; otherwise False. |
is_deactivated()
@classmethod
def is_deactivated() -> bool
Checks whether the application has been deactivated.
Returns
| Type | Description |
|---|---|
bool | True if the application is currently deactivated; otherwise False. |
activate()
@classmethod
def activate(
wait: bool = False
) -> [AppHandle](apphandle.md?sid=flyte__serve_apphandle)
Activates the application so it can begin serving requests.
Parameters
| Name | Type | Description |
|---|---|---|
| wait | bool = False | Whether to block execution until the application is fully activated. |
Returns
| Type | Description |
|---|---|
[AppHandle](apphandle.md?sid=flyte__serve_apphandle) | The activated application handle instance. |
deactivate()
@classmethod
def deactivate(
wait: bool = False
) -> [AppHandle](apphandle.md?sid=flyte__serve_apphandle)
Deactivates the application to stop serving requests.
Parameters
| Name | Type | Description |
|---|---|---|
| wait | bool = False | Whether to block execution until the application is fully deactivated. |
Returns
| Type | Description |
|---|---|
[AppHandle](apphandle.md?sid=flyte__serve_apphandle) | The deactivated application handle instance. |
ephemeral_ctx()
@classmethod
def ephemeral_ctx() -> AbstractAsyncContextManager[None]
Provides an asynchronous context manager that keeps the application active temporarily within the context scope.
Returns
| Type | Description |
|---|---|
AbstractAsyncContextManager[None] | An async context manager managing the temporary lifecycle of the application. |
ephemeral_ctx_sync()
@classmethod
def ephemeral_ctx_sync() -> AbstractContextManager[None]
Provides a synchronous context manager that keeps the application active temporarily within the context scope.
Returns
| Type | Description |
|---|---|
AbstractContextManager[None] | A synchronous context manager managing the temporary lifecycle of the application. |