MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / make_core

Function make_core

nodedb/src/data/executor/core_loop/tests.rs:12–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10use std::time::{Duration, Instant};
11
12fn make_core() -> (
13 CoreLoop,
14 Producer<BridgeRequest>,
15 Consumer<BridgeResponse>,
16 tempfile::TempDir,
17) {
18 let dir = tempfile::tempdir().unwrap();
19 let (req_tx, req_rx) = RingBuffer::channel::<BridgeRequest>(64);
20 let (resp_tx, resp_rx) = RingBuffer::channel::<BridgeResponse>(64);
21 let core = CoreLoop::open(
22 0,
23 req_rx,
24 resp_tx,
25 dir.path(),
26 std::sync::Arc::new(nodedb_types::OrdinalClock::new()),
27 )
28 .unwrap();
29 (core, req_tx, resp_rx, dir)
30}
31
32pub fn make_core_with_dir(
33 dir: &std::path::Path,

Calls 2

openFunction · 0.50
pathMethod · 0.45

Tested by

no test coverage detected