HTTP Component Timeout
Hi!
First I'd like to praise the project, pretty cool stuff :)
I'd like to know if there's a way to timeout an HTTP component after a defined amount of time. I have a CPU-bound operation on user data that may even lead to an 'infinite' loop.
Hi @jaime-amate, thanks for the kind words! Alas, there currently isn't any native support in the Spin for configuring a timeout for a component. The component itself would need to implement this logic.
I do see a related issue (though broader/more vague in scope) in https://github.com/fermyon/spin/issues/30. The request here seems to align with item 1 mentioned in https://github.com/fermyon/spin/issues/30#issuecomment-1074354557. Feel free to relay any further notes around your use case either here or in https://github.com/fermyon/spin/issues/30. This issue may be a great excuse to split out the thoughts in #30 into distinct features/functionality!
Hi just came across this, does this mean a component would always continue execution unless shut down manually?
It used to be the case that if a client cancelled a request then the component execution would stop, but reviewing the code now I think that may no longer necessarily be the case. An optional component timeout would certainly make sense to me.