# adonis-ws-redis-provider

> Provider for redis pubsub used for websockets

Latest version **1.1.1** (published 2019-04-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install adonis-ws-redis-provider
pnpm add adonis-ws-redis-provider
yarn add adonis-ws-redis-provider
bun add adonis-ws-redis-provider
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2019-04-22 |
| First published | 2019-04-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Oleksii Kurichenko |
| Maintainers | okurichenko |
| Keywords | adonisjs, adonis-framework, websocket, redis |

## Links

- npm: https://www.npmjs.com/package/adonis-ws-redis-provider
- npm.io page: https://npm.io/package/adonis-ws-redis-provider

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 1.1.1 (latest) — 2019-04-22
- 1.1.0 — 2019-04-22
- 1.0.0 — 2019-04-21

## README

# Adonis Websockets Redis Provider

This project provides listener and publisher for Redis PubSub in terms of adonis-websocket.

## Installation

Install addon via:
```bash
adonis install adonis-ws-redis-provider
```

Add provider to `start/app.js`:

```js
const providers = [
  'adonis-ws-redis-provider/providers/WsRedisProvider',
]
```

The next step is to open `server.js` and register preloader for redis subscriptions.

```js
new Ignitor(Fold)
  .appRoot(__dirname)
  .preLoad('start/redis')
  .wsServer() // <-- add this line
  .fireHttpServer()
  .catch(console.error)
```

Don't forget that this package relies on [adonis-websocket](https://github.com/adonisjs/adonis-websocket) and [adonis-redis](https://github.com/adonisjs/adonis-redis).

## How to use

Instead of

```js
Ws
  .getChannel('channel')
  .topic('topic')
  .broadcast(event, data)
```

just publish message like below:

```js
Ws.publish({
  topic: 'topic',
  event: 'event',
  payload: data,
})
```

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