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

Add pg-boss worker poc #2991

Merged
merged 4 commits into from
Dec 14, 2023
Merged

Add pg-boss worker poc #2991

merged 4 commits into from
Dec 14, 2023

Conversation

Weiko
Copy link
Member

@Weiko Weiko commented Dec 14, 2023

Context

This PR introduces a dedicated app that will run our queue workers.

yarn nx queue:work twenty-server will run the app which will then instantiate 1 worker per queue, each worker will then handle their dedicated jobs.

This PR has been tested only with pg-boss and not the bullmq driver (which is not used yet)

Test

Screen.Recording.2023-12-14.at.12.57.13.mov

Copy link
Member

@magrinj magrinj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be a good first approach, few comments on the API !

@Injectable()
export class MessagingProducer {
constructor(
@Inject(MessageQueues.messagingQueue)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Weiko As discuss, I think it's better to be based on @nestjs/bull api and create a decorator @InjectQueue that is going to strongly type it

};

@Injectable()
export class FetchMessagesJob implements MessageQueueJob<FetchMessagesJobData> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Weiko As discuss, we can imagine a decorator @Processor and @Process here

@Weiko Weiko merged commit 36164ab into main Dec 14, 2023
6 of 11 checks passed
@Weiko Weiko deleted the c--add-poc-for-pg-boss-worker branch December 14, 2023 17:57
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

2 participants