Replies: 3 comments 2 replies
-
Hi @kristoph, that is a great question! I had a quick look at So from what I can see, the only solution seem to raise an exception. However we first need to check the other clients/adapters as well |
Beta Was this translation helpful? Give feedback.
-
Thank you for the quick response. Looking at how this is handled in other languages I believe the most common technique is to simply call close on the connection/request and this then end the data stream. In Faraday, I see it calls app.close but I am sorry I don't know the code well enough to chase down what that does. Do you think that would work or should I throw an exception? More generally I think ideally there should be a method on a request like quit so that in the request block I can quit/end/stop just that request without impacting every other request. ( In Net::Http there is a finish on Http but this throws an exception. ) |
Beta Was this translation helpful? Give feedback.
-
Sorry to follow up on this but it still remains a pain point. In Net::HTTP the solution I can use is to call 'finish' on the http session. Is that a viable option for faraday? |
Beta Was this translation helpful? Give feedback.
-
What is the cleanest way to halt/stop a request inside on_data. This is specifically to support streaming responses from most LLM endpoints like Open AI and Anthropic.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions