Usage sample for redis crates below with actix-web.
- redis-rs
- without pooling
direct.rs
. - with r2d2 pooling
with_r2d2.rs
.
- without pooling
- bb8-redis
with_bb8.rs
. - deadpool-redis
with_deadpool.rs
. - mobc-redis
with_mobc.rs
. - r2d2-redis
with_alt_r2d2.rs
.
- cargo
- docker-compose
docker-compose up -d
cd app
cargo run
# to stop...
# Press Ctrl-C
# and
cd ../
docker-compose down
All endpoints accept HTTP GET method.
uuid
in /foo/{uuid}
is the string you'll get as the response of /foo
.
/direct
/direct/{uuid}
/with_r2d2
/with_r2d2/{uuid}
/bb8
/bb8/{uuid}
/deadpool
/deadpool/{uuid}
/mobc
/mobc/{uuid}
/alt_r2d2
/alt_r2d2/{uuid}
Example
$ curl localhost:8080/direct
e5aa716d-e647-484a-ad91-8864f20380b1 # no newline here actually
$ curl localhost:8080/direct/e5aa716d-e647-484a-ad91-8864f20380b1
hi # no newline here actually
MIT