samedi 18 juillet 2020

Node JS queue architecture best practice

I have a process which has 5 stages. I have implemented queue for each stage, (So the data after get processed in 1st queue, gets into 2nd queue..so on upto 5th queue ) Right now, there are 3 4 processes, each process doesn't require the data to flow through all the queues, for example, process2 should return the data after processing 3 queues, should not put in 4th queue. similarly process 3 should return after 2nd queue itself, there might be more queues, and more processes in future, (but data should not skip the queue, it has to go in order only)

As of now, i can attach a process type attribute in the data, and put if condition in all the queues, to check whether it has to stop or should go for next queue. i'm not sure whether it is a future proof , Please suggest some best practice/design pattern for the same.

Aucun commentaire:

Enregistrer un commentaire