https://github.com/sreeshaks/in-memory-queue
In Memory Low Latency Queue
https://github.com/sreeshaks/in-memory-queue
Last synced: 2 months ago
JSON representation
In Memory Low Latency Queue
- Host: GitHub
- URL: https://github.com/sreeshaks/in-memory-queue
- Owner: SreeshaKS
- Created: 2018-09-06T16:19:18.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-09-17T13:42:12.000Z (over 6 years ago)
- Last Synced: 2024-10-11T16:14:13.217Z (8 months ago)
- Language: JavaScript
- Size: 206 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# in-memory-queue
In Memory Low Latency Queue
# Running the example
1. ``` bash
npm install
```2. ```bash
node index.js
```# Architecture
- Infinite Polling With Events for De-Queue and En-Queue
- De-Queue
- Every Dequeue sends a event to with the 'EventName' as the routing key
- Consumers subscribe to the event associated with the routing key
- Queue acquires a mutex lock , and waits for an event from a consumer which is sent to the queue once the message is consumed
- Queue releases the mutex , de-queues and acquires the mutex once more
- Producers push the message with a particular event name as the routing key
- En-Queue
- Producer pushes the message with the particular event name as the routing key
- Dependency between Consumers
- Consumers resolve the Dependency on a FIFO basis
- Consumers can register dependencies and un-register at run-time