Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Send events to a message queue #16

Open
scls19fr opened this issue Jan 27, 2016 · 1 comment
Open

Send events to a message queue #16

scls19fr opened this issue Jan 27, 2016 · 1 comment

Comments

@scls19fr
Copy link
Member

MQTT https://en.wikipedia.org/wiki/MQTT may be considered

So it will be possible to "subscribe" to a given reader and wait for a given event.

See Mosquitto http://mosquitto.org/
Paho http://www.eclipse.org/paho/

AMQP https://en.wikipedia.org/wiki/Advanced_Message_Queuing_Protocol could also be considered

see Pika https://pika.readthedocs.org/

Serializing SQLAlchemy objects such as Events will probably be necessary
http://stackoverflow.com/questions/5022066/how-to-serialize-sqlalchemy-result-to-json
http://codelike.com/blog/2015/07/19/how-to-serialize-sqlalchemy-objects-to-json-in-pyramid/

@scls19fr
Copy link
Member Author

scls19fr commented May 2, 2016

This feature should be enabled only when for example mosquitto is installed

try:
    import mosquitto
    _HAS_MOSQUITTO = True
except ImportError:
    _HAS_MOSQUITTO = False

and we should serialize events and send them to queue only when mosquitto is installed

if _HAS_MOSQUITTO:
    ...

Configuration for mosquitto should be defined in https://github.com/RaspberryPi-Samples/py-my-key/blob/master/py_my_key/defaults.py

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant