iottly / iottly-core

Iottly Core
Apache License 2.0
3 stars 0 forks source link

polyglot: introduce an abstraction level between the main and brokers' clients #10

Open stefanoterna opened 7 years ago

stefanoterna commented 7 years ago

Architecture

Iottly BackendBrokerClients

Each client is basically a wrapper for the specific third party client (sleekxmpp or paho)

Currently we implement:

Each broker client is implemented as a class with the same interface:

Each BackendBrokerClient

Iottly Polyglot

The Polyglot class abstracts the interaction with each BackendBrokerClient:

Polyglot structure

Globals

A dictionary of currently loaded BackendBrokerClients

Constructor

__init__(backendbrokerclientconf: dict) Accepts a dict of parameters, grouped in a sub-dict for each of the required BackendBrokerClients:

backendbrokerclientconf = {
  'BackendBrokerClientXmpp': {
  # place here IOTTLY_XMPP_<...> settings needed by BackendBrokerClientXmpp
  },
  'BackendBrokerClientMqtt': {
  # place here IOTTLY_MQTT_<...> settings needed by BackendBrokerClientMqtt
  }
}

The constructor performs the following actions:

Methods

Main

The Main module must interact with each BackendBrokerClient solely via Polyglot. It knows:

stefanoterna commented 7 years ago

TODO