| Crates.io | pollination |
| lib.rs | pollination |
| version | 0.1.0 |
| created_at | 2025-10-13 20:06:53.09542+00 |
| updated_at | 2025-10-13 20:06:53.09542+00 |
| description | An experimental library exposing hybrid Raft and CRDT primitives. |
| homepage | https://github.com/byronwasti/florescence |
| repository | https://github.com/byronwasti/florescence |
| max_upload_size | |
| id | 1881065 |
| size | 173,412 |
An experimental library for hybrid Raft and CRDT primitives.
The following is all a demo of what the library will look like and is not implement yet aside from type system sketches.
// Start up the Flower
let flower = Flower::builder()
.engine(ToniRpc::new("0.0.0.0:8070".parse()?))
.bloom().await?;
// Attach various pollinators
let rate_limiter = flower.streaming_pollinator::<IdentityMap<u64>>();
// Kick off leaky-bucket background job
tokio::spawn(async || {
loop {
tokio::time::sleep(Duration::from_secs(1)).await;
rate_limiter.apply(|x| x - 1);
}
})
// on Request, do a fully local lookup
fn handle_request(..) {
rate_limiter.apply(|x| x + 1);
let rate = rate_limiter.fold(|acc, x| acc + x);
if rate > CONFIG_LIMIT {
return Err(Http503);
}
}
Licensed under either of:
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.