Servers Library

class dploylib.servers.Server(name, settings, control_uri, context, poll_loop=None)
class dploylib.servers.ServerDescription(server_cls)
class dploylib.servers.DployServer(name, settings, control_uri, context, poll_loop=None)

The actual server behind the scenes

add_socket(name, socket, handler=None)

Add the socket and it’s handler

start()

Run the poll loop for the server

dploylib.servers.bind_in(name, socket_type, obj=None)

A decorator that creates a SocketDescription describing a socket bound to receive input. The decorated function or method is used as the input event handler.

Parameters:
  • name – The name of the socket (for configuration purposes)
  • socket_type (str) – The lowercase name of the zeromq socket type
  • obj – (optional) A class or object that implements the deserialize method to deserialize incoming data
Returns:

A SocketDescription

dploylib.servers.bind(name, socket_type)

A decorator that creates a SocketDescription that describes a bound socket. This socket does not listen for input.

Parameters:
  • name – The name of the socket (for configuration purposes)
  • socket_type (str) – The lowercase name of the zeromq socket type
dploylib.servers.connect_in(name, socket_type, obj=None)

A decorator that creates a SocketDescription describing a socket connected to receive input. The decorated function or method is used as the input event handler.

Parameters:
  • name – The name of the socket (for configuration purposes)
  • socket_type (str) – The lowercase name of the zeromq socket type
  • obj – (optional) A class or object that implements the deserialize method to deserialize incoming data
Returns:

A SocketDescription

dploylib.servers.connect(name, socket_type)

A decorator that creates a SocketDescription that describes a connected socket. This socket does not listen for input.

Parameters:
  • name – The name of the socket (for configuration purposes)
  • socket_type (str) – The lowercase name of the zeromq socket type