I’ve got a situation where I don’t understand core.async’s
timeout behaviour, and I’m managing to completely lock up core.async. I’ve made a gist with an easily repeatable scenario.
As far as I can tell, using
(<!! (timeout n)) in a function that is called somewhere inside an async process causes core.async to completely lock up.
For some background, I’m writing a REST API client that leverages core.async extensively. The API has various rate limits in place, and I’m using @ericnormand’s fantastic token bucket with core.async implementation (thanks Eric!) to respect the rate limits at call time.
The sample code in the gist is from another project where I spiked out a core.async pipeline with “fake work”, to get a feel for how it works. In the actual pipeline
timeout is never used, so it works as advertised. But as a teaching/learning example it is kinda useless without
timeout because it just runs through and you don’t get a feel for how the pipeline executes. Using
println directly instead of printing through an agent clearly shows the crazy async processing happening.
Now I’ve got a real case for having a
timeout deep inside the core.async process, and it locks up
Any suggestions or feedback would be deeply appreciated