Hey friends, I put together a little experimental shard that brings Go-style contexts to Crystal. They’re a nice tool for making certain kinds of programs (web servers especially) more robust.
Because contexts are cooperative, this can live entirely as a shard. We don’t need runtime changes. The catch is that standard library classes like HTTP don’t respect them natively.
My one reservation is the Go ergonomics: you end up threading a context through every method call, and I’m not sure there’s a way around it.
Would love to hear what you all think and whether the structured concurrency work already has plans for a Crystal-flavored context library.