super_hydro.communication

Communications Module.

The communication layer has a Client and a Server. These manage the socket connections (with zmq). Requests and the actual network protocol are manged by Request objects which have a specialized request() method (for the Client to use) and a specialized respond() method (for the Server to use).

The general usage is that the server should call recv() which will return an appropriate Request object. The server should then respond by calling the Request.respond() method with appropriate objects.

Unless otherwise specified, messages should by bytes objects.

Functions

error(msg)

Return a JSON serializable quantity signaling an error.

log(msg[, level])

Log msg to the logger.

log_task(msg[, level])

Context for tasks with paired start and Done messages.

verifyClass(iface, candidate[, tentative])

Verify that the candidate might correctly provide iface.

Classes

Client(opts)

Basic communication class for the client.

NetworkServer(opts)

Wrapper for the server.Server class.

Server(opts)

implementer(*interfaces)

Declare the interfaces implemented by instances of a class.

Exceptions

TimeoutError

Operation timed out.