Privacywonk / MMM-Surf

MagicMirror module that pulls in tide, water temp, and Magicseaweed data to show an at-a-glance surf report for your favorite spot.
Other
5 stars 2 forks source link

Cache data for clients #34

Closed Privacywonk closed 6 years ago

Privacywonk commented 6 years ago

Currently, if multiple clients connect to the MMM-Surf module new API requests will be sent to data providers. This isn't good behavior...need to cache the data and send that, then update all clients.

Privacywonk commented 6 years ago

in node_helper, modified all API socket configurations

Pseudo code:

if notification == xyz && this.started == false
then
Fetch information, store it in xyzPayload, send to main module

if notification == xyz && this.started == true
then
send xyzPayload to main module