How to implement delay with acknowledgements? #3797
Answered
by
darrachequesne
shadypollen
asked this question in
Q&A
-
As per the documentation, we can have response-request using this:
And also have a timeout function server-side using this:
However, to test that my timeout function works correctly I wanted to simulate a delayed response on the client-side. This doesn't work if I wrap the body of my response in a |
Beta Was this translation helpful? Give feedback.
Answered by
darrachequesne
Feb 9, 2021
Replies: 1 comment 1 reply
-
I think the following shoud work: // client-side
socket.on("hello", (arg1, arg2, callback) => {
setTimeout(() => {
callback("hi");
}, 2000);
}); |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
shadypollen
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think the following shoud work: