Skip to content

LocalLinkClient

autogen.beta.network.transport.local.LocalLinkClient #

LocalLinkClient(endpoint_id, client_to_hub, hub_to_client)

Tenant-side half of an in-memory duplex.

Holds the two queues; send_frame writes to the client→hub queue, frames() reads from the hub→client queue. close() pushes a sentinel so the iterator terminates cleanly on both ends.

Source code in autogen/beta/network/transport/local.py
def __init__(
    self,
    endpoint_id: str,
    client_to_hub: "asyncio.Queue[Frame | None]",
    hub_to_client: "asyncio.Queue[Frame | None]",
) -> None:
    # __init__ stores params; no side effects.
    self.endpoint_id = endpoint_id
    self._c2h = client_to_hub
    self._h2c = hub_to_client
    self._closed = False

endpoint_id instance-attribute #

endpoint_id = endpoint_id

open async #

open()

No-op — connection is implicit at LocalLink.client() time.

Source code in autogen/beta/network/transport/local.py
async def open(self) -> None:
    """No-op — connection is implicit at ``LocalLink.client()`` time."""
    return None

send_frame async #

send_frame(frame)
Source code in autogen/beta/network/transport/local.py
async def send_frame(self, frame: Frame) -> None:
    if self._closed:
        return
    await self._c2h.put(frame)

frames #

frames()
Source code in autogen/beta/network/transport/local.py
def frames(self) -> AsyncIterator[Frame]:
    return self._frames_impl()

close async #

close()
Source code in autogen/beta/network/transport/local.py
async def close(self) -> None:
    if self._closed:
        return
    self._closed = True
    # Sentinel both directions so handlers on both sides stop iterating.
    await self._c2h.put(None)
    await self._h2c.put(None)