Exciting news!Announcing our $4.6M Series Seed. Learn more
Socket
LoveBlogFAQ
Install
Log in

redis-event-stream

Package Overview
Dependencies
0
Maintainers
1
Versions
30
Issues
File Explorer

Advanced tools

redis-event-stream

Simplified redis5 stream client for event driven architecture.

    0.1.28latest

Version published
Maintainers
1
Yearly downloads
5,522
decreased by-16.69%

Weekly downloads

Readme

Source

redis-event-stream

**Simplified redis5 stream client for event driven architecture.

npm version

Installation

npm install redis-event-stream

Examples

Configuration & Event Receiver

const { redisClient } = require('./redis'); //setup redis connection first const eventMaster = require('redis-event-stream'); const sampleReceiver = async event => { console.log(`feedbackSeen Event Received!!`); console.log(JSON.stringify(event, undefined, 2)); return true; //After the resolver consumes the event, it must return true. //Then that event will be removed from the stream group consumer list }; const { eventReceiver, eventEmitter } = eventMaster({ service: 'SERVICE_NAME', numOfReplicas: 1, redisClient }); eventReceiver({ receivers: [{ resolver: sampleReceiver, stream: 'EVENT_NAME', consumer: 'INSTANCE_ID' }] });

Event Emitter

const { eventReceiver, eventEmitter } = eventMaster({ service: 'SERVICE_NAME', numOfReplicas: 1, redisClient }); //after some business logic let eventBody = { foo: bar }; eventEmitter({ stream: 'EVENT_NAME', event: eventBody });

Contributing

If you find a bug or want to propose a feature, refer to the issues page.

Keywords

Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc