aboutsummaryrefslogtreecommitdiff
path: root/examples/demo1.rs
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2020-10-12 20:13:26 -0400
committerDeterminant <[email protected]>2020-10-12 20:13:26 -0400
commit54ce471c15fda9812d3cd7ef6222701b19892d30 (patch)
tree05f071fbe947242495cba6df84cbb5c32d9b024d /examples/demo1.rs
parent395bd19d51c5f5e0bfd3b5897ddce5f6bef5ec79 (diff)
add assertion for empty record payload; make `load` async funcv0.1.6
Diffstat (limited to 'examples/demo1.rs')
-rw-r--r--examples/demo1.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/examples/demo1.rs b/examples/demo1.rs
index 6f029ab..31a9b7d 100644
--- a/examples/demo1.rs
+++ b/examples/demo1.rs
@@ -1,3 +1,4 @@
+use futures::executor::block_on;
use growthring::{
wal::{WALBytes, WALRingId, WALLoader, WALWriter},
WALStoreAIO,
@@ -32,8 +33,8 @@ fn main() {
let mut loader = WALLoader::new();
loader.file_nbit(9).block_nbit(8);
- let store = WALStoreAIO::new(&wal_dir, true, None).unwrap();
- let mut wal = loader.load(store, recover).unwrap();
+ let store = WALStoreAIO::new(&wal_dir, true, None, None).unwrap();
+ let mut wal = block_on(loader.load(store, recover)).unwrap();
for _ in 0..3 {
test(
["hi", "hello", "lol"]
@@ -50,8 +51,8 @@ fn main() {
);
}
- let store = WALStoreAIO::new(&wal_dir, false, None).unwrap();
- let mut wal = loader.load(store, recover).unwrap();
+ let store = WALStoreAIO::new(&wal_dir, false, None, None).unwrap();
+ let mut wal = block_on(loader.load(store, recover)).unwrap();
for _ in 0..3 {
test(
vec![
@@ -64,8 +65,8 @@ fn main() {
);
}
- let store = WALStoreAIO::new(&wal_dir, false, None).unwrap();
- let mut wal = loader.load(store, recover).unwrap();
+ let store = WALStoreAIO::new(&wal_dir, false, None, None).unwrap();
+ let mut wal = block_on(loader.load(store, recover)).unwrap();
for _ in 0..3 {
let mut ids = Vec::new();
for _ in 0..3 {