🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

pub-sub-handler

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pub-sub-handler - npm Package Compare versions

Comparing version

to
0.0.2

1

index.js

@@ -14,2 +14,3 @@ /*

if( !options.port ) options.port = 6379;
if( !callback ) callback = function(){};

@@ -16,0 +17,0 @@ subscribeClient = redis.createClient(options.port, options.host);

2

package.json
{
"name": "pub-sub-handler",
"version": "0.0.1",
"version": "0.0.2",
"description": "Redis Pub/Sub with an object & key on message.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -6,3 +6,3 @@ ## Pub Sub Handler

Setup:
### Setup:

@@ -15,3 +15,3 @@ ```

Subscribing:
### Subscribing:

@@ -24,3 +24,3 @@ ```

Publishing:
### Publishing:

@@ -31,3 +31,3 @@ ```

Unsubscribing:
### Unsubscribing:

@@ -38,4 +38,11 @@ ```

### End:
(kill the Redis connections)
```
psh.end();
```
## Common Use
A typical use would be the key is a user id and the object is a socket. User connects to a web socket, you subscribe to a specified channel with the user id as a key and pass in the socket as the object. Then in your handler, when a message is published to the channel you have the socket to write the message to.