13 unstable releases (6 breaking)
0.7.3 | Feb 10, 2024 |
---|---|
0.6.0 | Jul 4, 2023 |
0.5.0 | Feb 9, 2023 |
0.4.0 | Nov 10, 2022 |
0.1.1 | Mar 28, 2022 |
#435 in Database interfaces
80 downloads per month
280KB
6K
SLoC
Redis Client for no_std
This crate offers a non-blocking Redis Client for no_std targets. Both RESP2 and RESP3 protocol are supported.
Documentation:
- Connection management
- Non-blocking response handling
- Popular command examples:
- Command abstraction
- Custom commands
- Subscriptions
Example
use core::str::FromStr;
use embedded_nal::SocketAddr;
use std_embedded_nal::Stack;
use std_embedded_time::StandardClock;
use embedded_redis::network::ConnectionHandler;
let mut stack = Stack::default();
let clock = StandardClock::default();
let server_address = SocketAddr::from_str("127.0.0.1:6379").unwrap();
let mut connection_handler = ConnectionHandler::resp2(server_address);
let client = connection_handler.connect(&mut stack, Some(&clock)).unwrap();
let future = client.set("key", "value").unwrap();
let response = future.wait().unwrap();
Development
Any form of support is greatly appreciated. Feel free to create issues and PRs. See DEVELOPMENT for more details.
Benchmarks
The following command can be used to run the benchmarks.
A local Redis instance is required.
cargo bench --features benchmarks
System | Async publish | Sync publish |
---|---|---|
Desktop *¹ | 291,800 msg / s | 70,025 msg / s |
Raspberry 4B *¹ | 59,744 msg / s | 10,641 msg / s |
*¹ Rust 1.67.0-nightly, AMD Ryzen 9, DDR4, Ubuntu 22.02, Redis v6.0.16
*¹ Rust 1.67.0-nightly, Raspberry Pi OS 10, Redis v7.0.5
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT) at your option.
Each contributor agrees that his/her contribution covers both licenses.
Dependencies
~5MB
~83K SLoC