-
Notifications
You must be signed in to change notification settings - Fork 102
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
Switch from Bull to Bree due to core issues + leaks + user complexity #496
Comments
I don’t wanna judge this recommendation, since I don’t feel like I have the expertise. Though I want to extend @niftylettuce issue, since important points we should consider in order to make a decision: From breejs Readme:
Digging through the Bull repo; @niftylettuce really tried to do an effort (see his PRs) to fix the mentioned issues & push them back upstream, but was unable to due to technical conflict with the Bull mainainter(s). EDIT: Disclaimer; I tried to to objectively summarize this topic what I found interesting, though better if you make a picture yourself about it. |
Bree looks very interesting based on a quick read of its documentation. I'd vote for a separate |
I was just looking into Bree but I don't see how it can be really used with NestJS and TypeScript in particular. It seems that jobs are supposed to go into separate What Bree does seems to mostly be the same as https://docs.nestjs.com/techniques/task-scheduling |
I guess it could be similar to how the TypeORM module allows specifying path glob for its entities. export const databaseProviders = [
{
provide: 'DATABASE_CONNECTION',
useFactory: async () => await createConnection({
...
entities: [
__dirname + '/../**/*.entity{.ts,.js}',
],
...
}),
},
]; Another example is of the GraphQLModule which allows configuring path glob for schema files. GraphQLModule.forRoot({
typePaths: ['./**/*.graphql'],
...
}), |
@andreialecu just note that |
@gaurav- TypeORM entities contain no code other than decorated properties though. So there is no need for dependency injection. Same for @niftylettuce I agree that Bree solves some problems. But it's not necessarily for everyone. Seems more of a I personally prefer to run my job runners in a cluster across multiple docker containers, for high availability. Seems like Bree isn't fit for that out of the box. I don't see any built-in distributed job locking support, or any sort of persistence mechanism (users need to write their own). I feel there's a much steeper learning curve to this approach. The main concern is: I'm not sure how you envision Bree to work with TypeScript in general, or even Babel, considering the need for files to be compiled. Other things like https://nx.dev/ complicate this approach even more. And how about Deno? As per your description it seems that Bree is more of a I'm sure at some point someone will create a It just feels that Bree is not quite fit yet for the TypeScript world in general, and I think that NestJS is one of the flagship projects of TypeScript, along with Angular. |
The core problem that many fail to see nor recognize are that there are core bugs in Bull that are still unresolved. For example, sometimes you will make repeatable jobs and they don't start. I'm not the only one that has reproduced this either. Just look at all the 300+ GitHub issues filed for Bull. People are in general, confused as to how it works, and also quite frequently complain about its slowness or uncertainty as to when jobs will start/repeat. Relying on Redis for a job scheduler is horrible practice, at the very least go back to Agenda for persistent storage, but even I don't recommend that as I'm a former core maintainer of Agenda and financially contributed out of my pocket towards its development. I also am strongly against TypeScript, but if someone wants to maintain TypeScript in Bree (and seriously will maintain it without my help) then I am open to that for sure. |
"I also am strongly against TypeScript" (@niftylettuce) Anyone who is strongly against static typing obviously doesn't understand it. Having a type system is the only way to use AST's to statically refactor projects at-scale, otherwise it would take countless hours to perform basic refactors, causing your project to calcify. |
As for switching from bull to bree - as the name suggests, this package is a wrapper for Bull ( |
Hello - I'm just sharing a package I created, which was recently featured on Node Weekly https://nodeweekly.com/issues/347 and has 100% code coverage. I built it out of frustration with core bugs in Bull, even after having created my own wrapper https://github.com/ladjs/bull. The author of Bull has blocked me from filing further issues and bugs I have discovered to say the least.
You can read more about it here https://jobscheduler.net/ or directly on GitHub at https://github.com/breejs/bree.
Would love to see Bree used in nestjs!
The text was updated successfully, but these errors were encountered: