batpak 0.8.2

Event sourcing with causal graphs and caller-defined gates. Sync API, no async runtime.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use batpak::store::StoreError;
use std::io;
use std::time::Duration;

const TEST_WAIT_TIMEOUT: Duration = Duration::from_secs(2);

pub fn writer_reply<T>(
    rx: &flume::Receiver<Result<T, StoreError>>,
    label: &str,
) -> Result<T, StoreError> {
    rx.recv_timeout(TEST_WAIT_TIMEOUT).map_err(|err| {
        StoreError::Io(io::Error::new(
            io::ErrorKind::TimedOut,
            format!("PROPERTY: timed out waiting for {label}: {err}"),
        ))
    })?
}