This project demonstrates a basic queue processing system using Redis, Express, and TypeScript. It includes two main components:
- Server: Handles incoming code submissions and pushes them to a Redis queue.
- Worker: Processes submissions from the Redis queue asynchronously.
docker run --name myredis -d -p 6379:6379 redis
- Clone the repository:
git clone https://github.com/your-username/redis-queue-impl.git
- Navigate to the project directory:
cd redis-queue-impl
- Install the dependencies:
npm install
- Start the Redis server.
- Run the Express server:
cd express-be npx tsc -b node dist/index.js
- The server will be running on
http://localhost:3000
.
- Start the Redis server (if not already running).
- Run the worker:
cd worker npx tsc -b node dist/index.js
- POST /submit
- Submits a code problem to be processed.
- Body Parameters:
problemId
(string): The ID of the problem.code
(string): The code submitted for the problem.language
(string): The programming language used.
URL -> http://localhost:3000/submit
Body -> RAW->JSON
{"problemId":"123","code":"console.log('Hello World')","language":"JavaScript"}