3.0.6 • Published 8 years ago

iotdb-transport-redis v3.0.6

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
8 years ago

iotdb-transport-redis

IOTDB Transporter for Redis

About

This Transporter writes data to Redis in JSON with keys named like paths. Currently does not have notification ability, we may add this in the near future.

Use

See the samples folder for working examples

Basic

Don't forget your subscribes! Most Transporter methods return RX Observables.

const redis_transport = require("iotdb-transport-redis");

We provide a helper to create a Redis client

const redis_client = redis_transport.connect({
    "host": "redis.example.com",
    "password": "abcdef0123",
    "db": 2
}, (error, redis_client) => {
    if (error) {
        return console.log("#", _.error.message(error));
    }
})

const redis_transporter = redis_transport.make({
    prefix: "/root",
}, redis_client);

redis_transport.put({
    id: "light",
    band: "ostate",
    value: { on: true }
}).subscribe()

Broadcasting

Here's how you send all data / updates to Redis

const iotdb = require("iotdb");
iotdb.use("homestar-wemo");

const things = iotdb.connect("WeMoSocket");

const iotdb_transport = require("iotdb-transport-iotdb");
const iotdb_transporter = iotdb_transport.make({}, things);

Create the Redis Transporter as per above. Then tell the Redis Transporter to get all the data from the IOTDB Transporter.

redis_transporter.use(iotdb_transporter)
3.0.6

8 years ago

3.0.5

8 years ago

3.0.4

8 years ago

3.0.3

8 years ago

3.0.2

8 years ago

3.0.1

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago