We have an async service that is kicked off via an initiate endpoint, this itself is easy to mock, as it just returns a 202 pending status. Is it possible to have mountebank wait say 10 secs then make a request out back to the calling api to a callback endpoint, posting the result of the async job? I see it’s possible to use npm modules, so would it be possible to use the request npm library inside an injection to post a stubbed result to the callback endpoint in the api which is itself calling mountebank?
--
You received this message because you are subscribed to the Google Groups "mountebank-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mountebank-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mountebank-discuss/cd51de28-f2f8-4f4d-b3b0-ef72469eb51a%40googlegroups.com.
Thanks for the reply. So as a short term solution making requests in a timeout from within an injection would work? When I have more free time I’d be keen to experiment with getting the shell transform approach working and help document the process.
--
You received this message because you are subscribed to the Google Groups "mountebank-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mountebank-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mountebank-discuss/0fceb8fa-fadf-48f5-9b23-8a0978cbe388%40googlegroups.com.
I’m not sure if the injection approach would work, but i suspect not. I think the problem is that even an asynchronous injection would have to return the response before making the callback, at which point the function variable would be garbage collected as there would no longer be a reference to it. I believe, but have not proved, that the shellTransform approach is the o pay way currently to maintain context long enough to send the callback.
On Sat, Feb 22, 2020 at 10:02 PM <rost...@gmail.com> wrote:
Thanks for the reply. So as a short term solution making requests in a timeout from within an injection would work? When I have more free time I’d be keen to experiment with getting the shell transform approach working and help document the process.
--
You received this message because you are subscribed to the Google Groups "mountebank-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mountebank-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mountebank-discuss/0fceb8fa-fadf-48f5-9b23-8a0978cbe388%40googlegroups.com.
I’m not sure if the injection approach would work, but i suspect not. I think the problem is that even an asynchronous injection would have to return the response before making the callback, at which point the function variable would be garbage collected as there would no longer be a reference to it. I believe, but have not proved, that the shellTransform approach is the o pay way currently to maintain context long enough to send the callback.
On Sat, Feb 22, 2020 at 10:02 PM <rost...@gmail.com> wrote:
Thanks for the reply. So as a short term solution making requests in a timeout from within an injection would work? When I have more free time I’d be keen to experiment with getting the shell transform approach working and help document the process.
--
You received this message because you are subscribed to the Google Groups "mountebank-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mountebank-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mountebank-discuss/0fceb8fa-fadf-48f5-9b23-8a0978cbe388%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to mountebank-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mountebank-discuss/0fceb8fa-fadf-48f5-9b23-8a0978cbe388%40googlegroups.com.
--Sent from Gmail Mobile
--
You received this message because you are subscribed to the Google Groups "mountebank-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mountebank-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mountebank-discuss/ba4b7397-c205-4f7a-a648-79ad852764a2%40googlegroups.com.