Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion mobile/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ local_path_override(
)

pip.parse(
experimental_index_url = "https://us-python.pkg.dev/artifact-foundry-prod/python-3p-trusted/simple/",
hub_name = "pypi",
python_version = PYTHON_VERSION,
requirements_lock = "//:requirements.txt",
Expand Down
12 changes: 8 additions & 4 deletions mobile/library/python/envoy_mobile/async_client/client.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
"""High level asyncio client built on top of the Envoy Mobile bindings."""

import asyncio
from typing import Any, Dict, List, Optional, Union
from typing import Any, Callable, Dict, List, Optional, Protocol, Union

from .. import envoy_engine
from ..envoy_engine import EngineBuilder

from .executor import AsyncioExecutor, Executor
from .response import ClientResponseError, Response
Expand All @@ -13,6 +12,11 @@
)


class EngineBuilderLike(Protocol):
def set_on_engine_running(self, closure: Callable[[], None]) -> "EngineBuilderLike": ...
def build(self) -> Any: ...


class AsyncClient:
"""A very small HTTP client that speaks the subset of envoy_requests
that we care about.
Expand All @@ -25,11 +29,11 @@ class AsyncClient:
Use as an async context manager: ``async with AsyncClient(engine_builder) as client:``
"""

def __init__(self, engine_builder: EngineBuilder) -> None:
def __init__(self, engine_builder: EngineBuilderLike) -> None:
"""Construct a new AsyncClient.

Args:
engine_builder: A pre-configured EngineBuilder to finalize and build.
engine_builder: A pre-configured EngineBuilder (or compatible builder object) to finalize and build.
"""
self._engine_builder = engine_builder
self._engine = None
Expand Down
Loading