Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/add bulljs #459

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

fuergaosi233
Copy link

Change

  • Add Bull and Demo
  • Add Nestjs Logger 2 Prisma Middleware

Why add

I think it's essential to use message queues in a production environment, so I've added a usage of Bull and I'm using it myself in a production environment, if you feel the need to add it to the main branch then I'll refine the documentation section and the testing section.

How to use

yarn start:consumer:dev

image

@isaiahdahl
Copy link

Just happen to be learning and browsing this PR and I got question about the worker.ts file. Is the idea that there would be a separate build for the workers that only runs the jobs? What's the reason behind that? That means you're adding a job to the queue in one app and processing the queue in another app, and that works because the data just all lives in redis?

@fuergaosi233
Copy link
Author

Just happen to be learning and browsing this PR and I got question about the worker.ts file. Is the idea that there would be a separate build for the workers that only runs the jobs? What's the reason behind that? That means you're adding a job to the queue in one app and processing the queue in another app, and that works because the data just all lives in redis?

A separate worker file is designed to decouple the Worker from the Server. For production environments, we put some long tasks in the background, so we need a separate worker file to ensure that it is a separate process. The communication between Server and Worker is done entirely through Redis.

@fuergaosi233
Copy link
Author

@marcjulian What do you think about this? This PR has been pending for a long time. 🤔

@luluhoc
Copy link
Contributor

luluhoc commented Sep 12, 2022

@marcjulian I think it should be merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants