Thank you. THis has me thinking a bit. Im not particularly interested in 'async io' -- as a design principle -- in this case. Rather 'what would happen' if http4k was used in the context of a coroutine-supporting application. In the use case pondered, its perfectly fine for threads to 'block' -- although its desirable to know upfront when that would (potentially) occur so the co-routines can be dispatched to an appropriate context/thread-pool prior to calling known-blockable apis.
In the 2 cases you mention (resilence4j and zipkintraces) -- the only thing I can think of (without studying their code) is reliance on thread local storage or in general assumptions about thread/state persistance. IFF the calls 'into' and 'out of' http4k are single threaded -- but between calls may change threads -- do you know offhand of cases where thread-locality is assumed that spans single request/responses ? I.e. on the client side, where its assumed that all calls occur from the same thread, and on the server side that assume all callbacks are dispatched to the same thread ?
This could occur, for example, if TLS is used to maintain state that outlives a single request/response.
historically Ive seen this in cases where a "Connection" object holds the state, and concurrency is defined wrt the connection ( i.e. do not use the same connection on 2 threads concurrently). -- Its conceivable that implementations store 'connection state' or similar in TLS instead where the rule would be 'Do not run on 2 threads concurrently OR sequentially'
The later can be managed by (fairly new) coroutine ThreadLocal support -- providing one knows what TLS variables to manage 🙂 -- which could be difficult or impossible without 'owning' the code using the TLS. But if the only (known) concerns are concurrency/synchronous related (not which thread but rather 'single threaded' - per request) then I would infer that using http4k in a co-routine enabled application would be no different then any other 3rd party java/JVM application that was not doing anything 'fancy' wrt threading.
This woudl imply that one could 'build on top of' http4k whatever async model one wishes using traditional thread-pool/futures/concurrency designs without major problems.