nspyre.data.source

Module Contents

Classes

DataSource

For sourcing data to the DataServer.

class nspyre.data.source.DataSource(name, addr='localhost', port=DATASERV_PORT, auto_reconnect=False)

For sourcing data to the DataServer. See pop() for typical usage example.

Parameters:
  • name (str) – Name of the data set.

  • addr (str) – Network address of the data server.

  • port (int) – Port of the data server.

  • auto_reconnect (bool) – If True, automatically reconnect to the data server if it is disconnected. Otherwise raise an error if connection fails.

start()

Connect to the data server.

stop()

Disconnect from the data server.

push(data)

Push new data to the data server.

Parameters:

data – Any python object (must be pickleable) to send. Ideally, this should be a dictionary to allow for simple attribute access from the sink side like sink.my_var.