https://github.com/c-cube/rcontext
Per-request context, inspired from Go's
https://github.com/c-cube/rcontext
context deadline ocaml
Last synced: about 1 year ago
JSON representation
Per-request context, inspired from Go's
- Host: GitHub
- URL: https://github.com/c-cube/rcontext
- Owner: c-cube
- Created: 2024-02-24T15:14:09.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-19T13:44:49.000Z (about 1 year ago)
- Last Synced: 2025-04-02T21:39:23.790Z (about 1 year ago)
- Topics: context, deadline, ocaml
- Language: OCaml
- Homepage: https://c-cube.github.io/rcontext/
- Size: 4.87 MB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rcontext
[](https://github.com/c-cube/rcontext/actions/workflows/main.yml)
[documentation](https://c-cube.github.io/rcontext/)
Rcontext is a immutable context to carry around in the processing of a
network request, or any other asynchronous task. It can carry around
cross-cutting concerns such as deadlines, tracing information, timing
information, debugging tags, etc.
At its core, a `Rcontext.t` is a wrapper around [hmap](https://github.com/dbuenzli/hmap),
alongside a set of standard hmap **keys**.
Each key provides access to some specific information (deadline, timing information, etc.)
The hope is that this can be a lightweight dependency for projects that
need to carry this kind of information around, and to help standardize _keys_.
[Rcontext] relies on
[dune's alternative dependencies](https://dune.readthedocs.io/en/stable/reference/library-dependencies.html#alternative-dependencies)
to use optional dependencies for standard keys, instead of hard dependencies.
## License
MIT