Synchronous IPyC Reference¶
The following outlines clients and their methods for synchronous IPyC use.
Note
This module uses the Python logging module to log diagnostic and errors in an output independent way. If the logging module is not configured, these logs will not be output anywhere. See Setting Up Logging for more information on how to set up and use the logging module with IPyC.
IPyC Host¶
-
class
ipyc.
IPyCHost
(ip_address: str = 'localhost', port: int = 9999)¶ Represents an abstracted synchronous socket listener that connects with and listens to
IPyCClient
clients. A number of options can be passed to theIPyCHost
.- Parameters
ip_address (Optional[
str
]) – The IP address start listening on. This defaults tolocalhost
.port (Optional[
int
]) – The port the listener binds to. This defaults to9999
. Check your system to make sure this port is not used by another service. To use multipleIPyCHost
hosts, ensure the ports are different between instantiations.
-
wait_for_client
() → ipyc.links.IPyCLink¶ Starts listening for
IPyCClient
clients to connect.- Returns
The connection that has been established with a
IPyCClient
.- Return type
IPyC Client¶
-
class
ipyc.
IPyCClient
(ip_address: str = 'localhost', port: int = 9999)¶ Represents an abstracted synchronous socket client that connects to and communicates with
IPyCHost
hosts. A number of options can be passed to theIPyCClient
.- Parameters
-
connect
() → ipyc.links.IPyCLink¶ A shorthand coroutine for asyncio.open_connection. Any arguments supplied are directly fed to that method. See the asyncio documentation for these arguments and their use.