Closed i18nsite closed 5 months ago
From the README:
After writing data (be it,
insert
,remove
or committing a write batch), you can choose to callKeyspace::persist
which takes aFlushMode
parameter. By default every 1000ms data is fsynced asynchronously. Also when dropped, the keyspace will try to persist the journal synchronously.
use fjall::{Config, FlushMode};
pub fn main() -> fjall::Result<()> {
let folder = std::path::Path::new("mydata");
let keyspace = Config::new(folder).open()?;
let items = keyspace.open_partition("items", Default::default())?;
// Write some data
items.insert("a", "hello")?;
items.insert("b", "world")?;
// Choose the FlushMode based on required durability guarantees
keyspace.persist(FlushMode::SyncAll)?;
Ok(())
}
How to flush manually ?
the config not has method flush
will the config auto flush when drop?