@ -237,3 +237,16 @@ class HTTP::Client
response
end
struct Crystal::ThreadLocalValue(T)
@values = Hash(Thread, T).new
def get(&block : -> T)
th = Thread.current
if !@values[th]?
@values[th] = yield
else
@values[th]