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
Act callback called twice on TimeoutError #32
Comments
Hi @acehko thanks for reporting. What is your expecting behaviour? If you fire a request and your client timeout is too low then you can run into a timeout issue but this does not implicit that the |
@StarpTech My exepected behaviour was at first that it should only call the callback once. I first noticed it in hemera but after a test it seems it is the same with seneca (redis-queue transport). After thinking a bit I think the current behavior is good. It just felt strange when I noticed it. Edit: I also noticed that the timeout error is not triggering any of the available response events |
@acehko I also thinking about the current behaviour and it is possible but we have to implement a
Yes new Hemera(nats, { timeout: 5000 })
Timeouts happens on client side. You get no response back the request will be handled as failed. |
@StarpTech I agree that you shouldn't break the current behaviour. |
That make sense. I will investigate in it. |
Thanks. I will close this as the original issue was resolved. |
@acehko is implemented see 2b98e05#diff-ee2c2206b5ed08491be6674035f0612a |
Hi @acehko I changed the behaviour because NATS has support for this. It is documented here https://hemerajs.github.io/hemera/1_request_reply.html As of now any request will process exact one response. If you want to get multiple responses you can use the |
Hi @StarpTech, thank you for the update. |
@acehko it means that you can receive only one message but the callback can be called multiple times. |
If a timeout error occurs when a service is taking a longer time to respond the act callback is called twice. Once when the timeout error occurs and the second time when the service has finished the request:
Example:
Output:
The text was updated successfully, but these errors were encountered: