IoTPy.tools.distributed package

Submodules

IoTPy.tools.distributed.server module

IoTPy.tools.distributed.server.run(host='localhost', user='guest', password='guest')[source]

Runs a listener to assemble templates

This function assembles parts received from rabbitmq. Each part is run in a process.

Parameters:

host : str, optional

Name of the server for rabbitmq (the default is localhost).

user : str, optional

Name of the user for rabbitmq (the default is guest)

password : str, optional

User password for rabbitmq (the default is guest)

IoTPy.tools.distributed.server.start(body, host, user, password)[source]

Assembles a template and starts sink and source

Parameters:

body : str

String containing parameters for template

host : str

Name of the server for rabbitmq

user : str

Name of the user for rabbitmq

password : str

User password for rabbitmq

IoTPy.tools.distributed.sink module

IoTPy.tools.distributed.sink.addToQueue(value, exchange, channel, part_name, name, index=None)[source]

Adds a value to a queue for rabbitmq

Parameters:

value : object

Value to send

exchange : str

Name of the exchange

channel : pika channel

Channel to send value

part_name : str

Name of the part to send to

name : str

Name of the parameter

index : int, optional

Index of the parameter (the default is None)

IoTPy.tools.distributed.sink.sink(exchange, fields, dict_parts, host='localhost', user='guest', password='guest')[source]

Create sinks for each stream in fields

Parameters:

exchange : str

Name of the exchange

fields : list

List of field names

dict_parts : dict

Dict containing values for fields

host : str, optional

Name of the server for rabbitmq (the default is localhost).

user : str, optional

Name of the user for rabbitmq (the default is guest)

password : str, optional

User password for rabbitmq (the default is guest)

IoTPy.tools.distributed.source module

IoTPy.tools.distributed.source.source(exchange, name, dict_parts, host='localhost', user='guest', password='guest')[source]

Listens on rabbitmq queue and adds values to streams

Parameters:

exchange : str

Name of the exchange

name : str

Name of the part

dict_parts : dict

Dict containing values for fields

host : str, optional

Name of the server for rabbitmq (the default is localhost).

user : str, optional

Name of the user for rabbitmq (the default is guest)

password : str, optional

User password for rabbitmq (the default is guest)

Module contents