|
The documentation of send method indicates:
When the return value is 0:
I would like to retry the failed messages. Is this below approach correct? I am maintaining a const retryQ= [];
const sendNow = (ws, msg) => {
const status = ws.send(msg, true, true);
switch (status) {
case 1: // sent successfully, nothing to do
return status;
case 2: { // dropped due to backpressure, lets try again later after drain even
retryQ.push(msg);
return status;
}
case 0: { // built-up backpressure: what should be done????
retryQ.push(msg); //<<-- should we retry the message again or has it already been queued at socket?
return status;
}
}
}; |
Answered by
e3dio
Nov 18, 2022
Replies: 1 comment 3 replies
case 0: { // built-up backpressure: what should be done????It is already in backpressure queue ready to send out, you don't need to do anything there. Only need to handle the dropped messages |
3 replies
Answer selected by
KrishnaPG
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It is already in backpressure queue ready to send out, you don't need to do anything there. Only need to handle the dropped messages