Answer the question
In order to leave comments, you need to log in
Is it okay to communicate with microservices through promises?
Is it normal practice to communicate with microservices through promises?
There is a similar design:
const getData = (data) => {
return new Promise((resolve, reject) => {
rpc.send(data);
rpc
.onRequest(newData => resolve(newData))
.onError(error => reject(error));
})
}
Answer the question
In order to leave comments, you need to log in
Practice is normal.
Both "what if" problems are contrived and irrelevant.
What specifically would you like to do in case of a delayed response? Let's say we set a threshold of 10 seconds. Still no answer.
The options, in fact: wait some more, or reject. You can also imagine the option - to abort the previous attempt and send the same thing again.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question