A case study for `reasync`

Well, fellow posters have before put forward such simple use cases for reasync, but it appears some of the people in charge remain unconvinced anyway; I speculated their objection could be "Why don't you just duplicate the code: one sync function and one async function?", so I cleaned up and posted this use case, where there is enough complexity that "just duplicating" the code in question is not reasonable, and this objection therefore moot.

(Here this complexity is also inherent to performing a reasonably useful computation, so as to preemptively answer the objection that this complexity was artificially added in order to make a point).

2 Likes