| 163 | use nodedb_types::Surrogate; |
| 164 | |
| 165 | fn make_core() -> ( |
| 166 | CoreLoop, |
| 167 | nodedb_bridge::buffer::Producer<crate::bridge::dispatch::BridgeRequest>, |
| 168 | nodedb_bridge::buffer::Consumer<crate::bridge::dispatch::BridgeResponse>, |
| 169 | tempfile::TempDir, |
| 170 | ) { |
| 171 | let dir = tempfile::tempdir().unwrap(); |
| 172 | let (req_tx, req_rx) = RingBuffer::channel::<crate::bridge::dispatch::BridgeRequest>(64); |
| 173 | let (resp_tx, resp_rx) = RingBuffer::channel::<crate::bridge::dispatch::BridgeResponse>(64); |
| 174 | let core = CoreLoop::open( |
| 175 | 0, |
| 176 | req_rx, |
| 177 | resp_tx, |
| 178 | dir.path(), |
| 179 | Arc::new(nodedb_types::OrdinalClock::new()), |
| 180 | ) |
| 181 | .unwrap(); |
| 182 | (core, req_tx, resp_rx, dir) |
| 183 | } |
| 184 | |
| 185 | /// Build a governor with every engine having `budget_bytes`, then |
| 186 | /// pre-fill `engine` to `utilization_percent`. |