mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
20 lines
423 B
TypeScript
20 lines
423 B
TypeScript
import NRP = require("node-redis-pubsub");
|
|
import { RedisClient } from "redis";
|
|
|
|
const options = {
|
|
port: 6379
|
|
};
|
|
const nrp: NRP.NodeRedisPubSub = NRP(options);
|
|
|
|
nrp.on("message:*", (data, channel) => {});
|
|
|
|
nrp.subscribe("message:*", (data, channel) => {});
|
|
|
|
const redis: RedisClient = nrp.getRedisClient();
|
|
|
|
nrp.emit("message:test", "hello world");
|
|
nrp.publish("message:test2", "hello world2");
|
|
|
|
nrp.quit();
|
|
nrp.end();
|