# Crystal Contexts

**URL:** <https://forum.crystal-lang.org/t/crystal-contexts/9037>\
**Category:** Community\
**Created:** [June 29, 2026, 10:31pm UTC](https://forum.crystal-lang.org/t/crystal-contexts/9037 "2026-06-29T22:31:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mgomes](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/mgomes/32/1621_2.png) [@mgomes](https://forum.crystal-lang.org/u/mgomes)\
**Post date:** [June 29, 2026, 10:31pm UTC](https://forum.crystal-lang.org/t/crystal-contexts/9037/1 "2026-06-29T22:31:42Z")

</div>

Hey friends, I put together a little experimental shard that brings [Go-style contexts](https://pkg.go.dev/context) 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.

> **[GitHub - mgomes/context: Crystal shard for cooperative cancellation,...](https://github.com/mgomes/context)**
>
> Crystal shard for cooperative cancellation, deadlines, and request-scoped values.
