Skip to content

Class swarmauri_core.transports.i_multiplex.IMultiplexTransport

swarmauri_core.transports.i_multiplex.IMultiplexTransport

Bases: ABC

Interface for transports that expose multiplexed channels.

open_channel abstractmethod async

open_channel()

Open a logical channel on the transport.

Source code in swarmauri_core/transports/i_multiplex.py
15
16
17
@abstractmethod
async def open_channel(self) -> ChannelHandle:
    """Open a logical channel on the transport."""

close_channel abstractmethod async

close_channel(handle)

Close a previously opened channel.

Source code in swarmauri_core/transports/i_multiplex.py
19
20
21
@abstractmethod
async def close_channel(self, handle: ChannelHandle) -> None:
    """Close a previously opened channel."""

send_on abstractmethod async

send_on(handle, data, *, timeout=None)

Send data on a specific channel.

Source code in swarmauri_core/transports/i_multiplex.py
23
24
25
26
27
@abstractmethod
async def send_on(
    self, handle: ChannelHandle, data: bytes, *, timeout: Optional[float] = None
) -> None:
    """Send data on a specific channel."""

recv_on abstractmethod async

recv_on(handle, *, timeout=None)

Receive data from a specific channel.

Source code in swarmauri_core/transports/i_multiplex.py
29
30
31
32
33
@abstractmethod
async def recv_on(
    self, handle: ChannelHandle, *, timeout: Optional[float] = None
) -> bytes:
    """Receive data from a specific channel."""