# redis-subscription-pool

> Smart subscription pooling for node-redis

Latest version **0.0.1** (published 2014-01-14) · 0 weekly downloads

## Install

```sh
npm install redis-subscription-pool
pnpm add redis-subscription-pool
yarn add redis-subscription-pool
bun add redis-subscription-pool
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2014-01-14 |
| First published | 2014-01-14 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | juliangruber |

## Links

- npm: https://www.npmjs.com/package/redis-subscription-pool
- Repository: https://github.com/juliangruber/redis-subscription-pool
- Issues: https://github.com/juliangruber/redis-subscription-pool/issues
- npm.io page: https://npm.io/package/redis-subscription-pool

## Recent versions

- 0.0.1 (latest) — 2014-01-14

## README

# redis-subscription-pool

Smart subscription pooling for node-redis. Handles many subscriptions with one client and knows when it's save to unsubscribe.

## Example

```js
var redis = require('redis');
var Pool = require('redis-subscription-pool');

var pub = redis.createClient();
var sub = redis.createClient();
var pool = Pool(sub);

var unbind = pool.on('foo', function(msg){
  console.log('got %s', msg);
});

// ...

pub.publish('foo', 'bar');

// ...

unbind();
```

## API

### Pool(subscriber)

### pool.on(channel, fn)

Subscribe `fn` to updates on `channel`. Returns an `unbind` function that unbinds *immediately*.

### pool.pon(pattern, fn)

Subscribe `fn` to updates on `pattern`. Returns an `unbind` function that unbinds *immediately*.

**TODO** this name sucks

## Installation

```bash
$ npm install redis-subscription-pool
```

## License

MIT

---
_Source: https://npm.io/package/redis-subscription-pool · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
