Fork me on GitHub
#ring
<
2022-10-27
>
hifumi12305:10:48

How would I wrap a handler's response body with a delay ? I want to be able to use the wrap-head middleware without paying the full cost of responding to a GET request. Searching online, I found out that one way to do this was to wrap the response body in a delay, but I don't see how this helps,

weavejester02:10:43

You can wrap the body in a delay, and then extend the StreamableResponseBody protocol to resolve it.

hifumi12321:10:33

Huh. I was trying to do exactly this but I kept getting "Body class not supported". Turns out my Ring adapter does not conform to the spec, but extending its own RespondBody protocol did the trick. Thanks for the help!

weavejester08:11:38

Which Ring adapter are you using, out of interest?

hifumi12314:11:43

[luminus/ring-undertow-adapter "1.2.8"] I do not use the luminus framework; but I do make use of this ring adapter