package orewa
All checked builds passInstall
dune-project
Dependency
Authors
Maintainers
Sources
sha256=50c2bc62230a94f0856b9f2e414c6bff501fbf2071438d17cabdc0093bee718a
sha512=fba593b4fa15b557dceb3aa11e26a56f0de0308b321bf6e57b4d064f316efa18f5af44387e36c60509bfd954767230275dd29a051a95c8dcaad558b035d2778b
Description
Async-friendly Redis client
Orewa is a Redis client designed with cooperative multithreading in mind, thus operations are non-blocking by default.
It also features an OCaml-friendly Redis API wrapping the stringly constructs of the Redis commands into a more typed and less fragile interface that does its best to provide a pleasant interface.
Added to opam-repository:
README
Orewa
俺は - an Async friendly Redis binding in pure OCaml.
Installation
It is availaible on OPAM, just
opam install orewaand off you go! No need to install any native libraries or other dependencies.
Usage
To connect to a Redis server use Orewa.connect which will return a handle to a connection. From here you can use all the implemented Redis commands in Orewa.* and also close the connection with Orewa.close. Or just use Orewa.with_connection to handle connection handling for you.
Orewa opts in to offering an OCaml-centric API, so the commands map to functions and these take typed arguments. So instead of distinguishing between seconds and millisecond variants, in Orewa both are represented by a time span type. Different options to commands are represented by ADTs, to avoid constructing invalid commands. The results are mapped into the most fitting OCaml data types. Orewa also avoids exceptions, so the signature will tell you exactly which error types are expected.
Examples
The integration test in src/integration/test.ml attempts to test all implemented commands, so it demonstrates how each of them can be used.
Documentation
The API documentation of the current release is available online. The naming of the functions follows the naming of Redis commands so it is simple to adapt from the Redis docs to OCaml.
Roadmap
Currently all commands from the string category in Redis 5 are implemented. Over time this set is meant to be expanded. If you need support for a specific command, submit a pull request.
For a very preliminary draft of what could be coming over time here's a list of ideas:
- Most (all?) sensible Redis commands
- Transactions in Redis
- Cluster support, maybe. Unlikely to happen any time soon.
Dependencies (5)
-
ppx_deriving
>= "4.2" -
ppx_let
>= "v0.11" -
dune
>= "1.4" -
core
>= "v0.11" -
async
>= "v0.11"
Dev Dependencies (2)
-
alcotest-async
with-test & >= "0.8.2" -
alcotest
with-test & >= "0.8.4"
Optional Dependencies
None
Used by
None
Conflicts
None
Build status
Results of building orewa with each compiler on check.ci.ocaml.org, run of against opam-repository 8d8d144. All results for this package.
Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.
| Version | OCaml 4.11 | OCaml 4.14 | OCaml 5.2 | OCaml 5.4 | OCaml 5.5 |
|---|---|---|---|---|---|
| 0.2.1 (this version) | good | good | good | good | good |
- good Package successfully built
- partial One of the dependencies failed to build
- bad Package failed to build
- n/a Package is not available in this environment
- internal Internal failure