Closed cheatfate closed 1 year ago
If you add waitFor sleepAsync(600.milliseconds)
, at the end you'll see that the stage 2 & 3 are also executed, but after the testFoo
future has been completed
So the closure iterator transformation seems correct, it's actually chronos/asyncdispatch which is completing the future too early
Reproducible source
Current output
Expected output
Workaround
If you change
return ClientResponse(status: status, data: data)
toresult = ClientResponse(status: status, data: data)
or implicitly returnClientResponse(status: status, data: data)
all statements infinally
will be executed.