aleph

Leonid Korogodski 2022-08-12T13:54:22.269299Z

Does aleph server close the InputStreams that it sends as responses? Say, I have a reitit route like this:

["/my/route"
  {:get {;; a lot of stuff
         :handler (function-that-returns-response-with-body-as-inputstream)}}]
The handler returns a response whose :body is an InputStream. Will aleph call .close on it after it's done streaming it out? Because I cannot close it while it is still being streamed, and I don't know when aleph would be done with it. Or is there a post-processing callback that I can use? Or does aleph guarantee that the stream will be closed (as I would expect when passing it on in this fashion)?

➕ 1
Matthew Davidson 2022-08-13T15:16:55.414099Z

Yes, Aleph closes it when done. See send-streaming-body and byte-streams’ conversion-fn for details

👍 2
Leonid Korogodski 2022-08-15T14:57:09.291049Z

Thanks for the confirmation!