adapter
ModuleContents
Structs
SharedTableA table of rows shared by every `Table` adapter made on it: one per process (or per worker group) where Swoole would share memory.TableShares breaker state through a `SharedTable` in this process, under a key prefix (`breaker:` by default). Keys longer than 63 bytes are hashed to fit.use utopia_circuit_breaker::Table;Rust
pub struct TableShares breaker state through a SharedTable in this process, under a
key prefix (breaker: by default). Keys longer than 63 bytes are hashed
to fit.
Rust
use utopia_circuit_breaker::{Adapter, SharedTable, Stored, Table};
let table = SharedTable::new(32, 255);
let first = Table::new(table.clone(), "test:");
let second = Table::new(table, "test:");
first.set("failures", Stored::Int(2)).await?;
assert_eq!(second.increment("failures", 1).await?, 3);use utopia_circuit_breaker::Stored;Rust
pub enum StoredA value in a store: a string or an integer.
Also implements
From.use utopia_circuit_breaker::Adapter;Rust
pub trait Adapter: Send + SyncWhere breakers keep the state they share: a key-value store with increments. Implement it to share state another way.
Implemented byArcTable