-
-
Notifications
You must be signed in to change notification settings - Fork 285
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
BullMQ - Flow #2600
Comments
Hello @jonathanroze import {FlowProducer} from "bullmq";
@Module()
export class FlowProducerModule {
$onInit() {
const flowProducer = new FlowProducer();
const flow = await flowProducer.add({
name: "renovate-interior",
queueName: "renovate",
children: [
{name: "paint", data: {place: "ceiling"}, queueName: "steps"},
{name: "paint", data: {place: "walls"}, queueName: "steps"},
{name: "fix", data: {place: "floor"}, queueName: "steps"}
]
});
}
} or maybe using custom async factory ? I think the only missing thing is the documentation. Maybe you have in mind something better ? See you |
Hi @Romakita ! I don't know how to integrate it properly in TSED directly, but I used a service to deal with it.
Probably not the best way but it's working great! |
Hello @jonathanroze Sorry for the late answer. Instead of using a injectable class to wrap your Flow, you can use a custom factory: import {Configuration, Injectable, registerProvider} from "@tsed/di";
import { FlowJob, FlowProducer } from "bullmq";
registerProvider({
provide: FlowProducer,
deps: [Configuration],
useFactory: (config: Configuration) => {
return new FlowProducer({
connection: {
host: config.get("redis.host"),
port: config.get("redis.port"),
},
});
},
})
Also,Ts.ED provide We can add this example on the doc if the solution is ok for you ;) (PR welcome) See you |
Is your feature request related to a problem? Please describe.
No response
Describe the solution you'd like
Hi,
I think it will be a good idea to implement new Flow systeme provided by BullMQ in Tsed.
Here documentation: https://docs.bullmq.io/guide/flows
Not enough comfortable with TSED.IO to implement it myself for now, so if someone is interested, it's a pretty cool feature :)
Describe alternatives you've considered
No response
Additional context
No response
Acceptance criteria
No response
The text was updated successfully, but these errors were encountered: