aea.helpers.pipe¶
Portable pipe implementation for Linux, MacOS, and Windows.
IPCChannelClient Objects¶
Multi-platform interprocess communication channel for the client side.
connect¶
Connect to communication channel
Arguments:
timeout
: timeout for other end to connect
Returns:
connection status
write¶
Write data
bytes to the other end of the channel
Will first write the size than the actual data
Arguments:
data
: bytes to write
read¶
Read bytes from the other end of the channel
Will first read the size than the actual data
Returns:
read bytes
close¶
Close the communication channel.
IPCChannel Objects¶
Multi-platform interprocess communication channel.
in_
path¶
Rendezvous point for incoming communication.
Returns:
path
out_
path¶
Rendezvous point for outgoing communication.
Returns:
path
PosixNamedPipeProtocol Objects¶
Posix named pipes async wrapper communication protocol.
__
init__
¶
def __init__(in_path: str,
out_path: str,
logger: logging.Logger = _default_logger,
loop: Optional[AbstractEventLoop] = None) -> None
Initialize a new posix named pipe.
Arguments:
in_path
: rendezvous point for incoming dataout_path
: rendezvous point for outgoing datalogger
: the loggerloop
: the event loop
connect¶
Connect to the other end of the pipe
Arguments:
timeout
: timeout before failing
Returns:
connection success
write¶
Write to pipe.
Arguments:
data
: bytes to write to pipe
read¶
Read from pipe.
Returns:
read bytes
close¶
Disconnect pipe.
TCPSocketProtocol Objects¶
TCP socket communication protocol.
__
init__
¶
def __init__(reader: asyncio.StreamReader,
writer: asyncio.StreamWriter,
logger: logging.Logger = _default_logger,
loop: Optional[AbstractEventLoop] = None) -> None
Initialize the tcp socket protocol.
Arguments:
reader
: established asyncio readerwriter
: established asyncio writerlogger
: the loggerloop
: the event loop
writer¶
Get a writer associated with protocol.
write¶
Write to socket.
Arguments:
data
: bytes to write
read¶
Read from socket.
Returns:
read bytes
close¶
Disconnect socket.
TCPSocketChannel Objects¶
Interprocess communication channel implementation using tcp sockets.
__
init__
¶
def __init__(logger: logging.Logger = _default_logger,
loop: Optional[AbstractEventLoop] = None) -> None
Initialize tcp socket interprocess communication channel.
connect¶
Setup communication channel and wait for other end to connect.
Arguments:
timeout
: timeout for the connection to be established
Returns:
connection status
write¶
Write to channel.
Arguments:
data
: bytes to write
read¶
Read from channel.
Returns:
read bytes
close¶
Disconnect from channel and clean it up.
in_
path¶
Rendezvous point for incoming communication.
out_
path¶
Rendezvous point for outgoing communication.
PosixNamedPipeChannel Objects¶
Interprocess communication channel implementation using Posix named pipes.
__
init__
¶
def __init__(logger: logging.Logger = _default_logger,
loop: Optional[AbstractEventLoop] = None) -> None
Initialize posix named pipe interprocess communication channel.
connect¶
Setup communication channel and wait for other end to connect.
Arguments:
timeout
: timeout for connection to be established
Returns:
bool, indicating success
write¶
Write to the channel.
Arguments:
data
: data to write to channel
read¶
Read from the channel.
Returns:
read bytes
close¶
Close the channel and clean it up.
in_
path¶
Rendezvous point for incoming communication.
out_
path¶
Rendezvous point for outgoing communication.
TCPSocketChannelClient Objects¶
Interprocess communication channel client using tcp sockets.
__
init__
¶
def __init__(in_path: str,
out_path: str,
logger: logging.Logger = _default_logger,
loop: Optional[AbstractEventLoop] = None) -> None
Initialize a tcp socket communication channel client.
Arguments:
in_path
: rendezvous point for incoming dataout_path
: rendezvous point for outgoing datalogger
: the loggerloop
: the event loop
connect¶
Connect to the other end of the communication channel.
Arguments:
timeout
: timeout for connection to be established
Returns:
connection status
write¶
Write data to channel.
Arguments:
data
: bytes to write
read¶
Read data from channel.
Returns:
read bytes
close¶
Disconnect from communication channel.
PosixNamedPipeChannelClient Objects¶
Interprocess communication channel client using Posix named pipes.
__
init__
¶
def __init__(in_path: str,
out_path: str,
logger: logging.Logger = _default_logger,
loop: Optional[AbstractEventLoop] = None) -> None
Initialize a posix named pipe communication channel client.
Arguments:
in_path
: rendezvous point for incoming dataout_path
: rendezvous point for outgoing datalogger
: the loggerloop
: the event loop
connect¶
Connect to the other end of the communication channel.
Arguments:
timeout
: timeout for connection to be established
Returns:
connection status
write¶
Write data to channel.
Arguments:
data
: bytes to write
read¶
Read data from channel.
Returns:
read bytes
close¶
Disconnect from communication channel.
make_
ipc_
channel¶
def make_ipc_channel(logger: logging.Logger = _default_logger,
loop: Optional[AbstractEventLoop] = None) -> IPCChannel
Build a portable bidirectional InterProcess Communication channel
Arguments:
logger
: the loggerloop
: the loop
Returns:
IPCChannel
make_
ipc_
channel_
client¶
def make_ipc_channel_client(
in_path: str,
out_path: str,
logger: logging.Logger = _default_logger,
loop: Optional[AbstractEventLoop] = None) -> IPCChannelClient
Build a portable bidirectional InterProcess Communication client channel
Arguments:
in_path
: rendezvous point for incoming communicationout_path
: rendezvous point for outgoing outgoinglogger
: the loggerloop
: the loop
Returns:
IPCChannel