ptypy.io.interaction.Server#

class ptypy.io.interaction.Server(pars=None, **kwargs)#

Bases: object

Main ZMQ server class.

__init__(pars=None, **kwargs)#

Interaction server, meant to run asynchronously with process 0 to manage client requests.

Parameters:

pars (dict or Param) – Parameter set for the server.

Keyword Arguments:
  • address (str) – Primary address

  • port (int) – Primary port

  • connections (int) – number of ports to open on demand behind the primary port.

  • poll_timeout (float) – Network polling interval (in milliseconds!).

  • pinginterval (float) – Interval to check pings (in seconds).

  • pingtimeout (float) – Ping time out: client disconnected after this period (in seconds).

Methods

__init__([pars])

Interaction server, meant to run asynchronously with process 0 to manage client requests.

activate()

This needs to be run for the thread to initialize.

make_ID_pool()

process_requests([tinterval])

Give permission to the serving thread to send objects and wait for it to complete (safer!)

register(obj, name)

Exposes the content of an object for transmission and interaction.

send_error(error_message)

Queue an ERROR message for all connected clients.

send_warning(warning_message)

Queue a warning message for all connected clients.

stop()

Attributes

DEFAULT

activate()#

This needs to be run for the thread to initialize. Returns port where the server listens or None if Server failed

process_requests(tinterval=0.001)#

Give permission to the serving thread to send objects and wait for it to complete (safer!)

register(obj, name)#

Exposes the content of an object for transmission and interaction. For now this is equivalent to Interactor.object[name] = obj, but maybe use weakref in the future?

send_error(error_message)#

Queue an ERROR message for all connected clients.

send_warning(warning_message)#

Queue a warning message for all connected clients.