forked from ROMEO/nexosim
Small changes and cleanups to prepare the RPC work
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
use std::time::Duration;
|
||||
|
||||
use asynchronix::model::{Model, Output};
|
||||
use asynchronix::simulation::{Address, EventStream, Mailbox, SimInit, Simulation};
|
||||
use asynchronix::simulation::{Address, EventQueue, Mailbox, SimInit, Simulation};
|
||||
use asynchronix::time::MonotonicTime;
|
||||
|
||||
// Input-to-output pass-through model.
|
||||
@ -26,12 +26,13 @@ impl<T: Clone + Send + 'static> Model for PassThroughModel<T> {}
|
||||
/// output) running as fast as possible.
|
||||
fn passthrough_bench<T: Clone + Send + 'static>(
|
||||
t0: MonotonicTime,
|
||||
) -> (Simulation, Address<PassThroughModel<T>>, EventStream<T>) {
|
||||
) -> (Simulation, Address<PassThroughModel<T>>, EventQueue<T>) {
|
||||
// Bench assembly.
|
||||
let mut model = PassThroughModel::new();
|
||||
let mbox = Mailbox::new();
|
||||
|
||||
let out_stream = model.output.connect_stream().0;
|
||||
let out_stream = EventQueue::new();
|
||||
model.output.connect_sink(&out_stream);
|
||||
let addr = mbox.address();
|
||||
|
||||
let simu = SimInit::new().add_model(model, mbox).init(t0);
|
||||
@ -243,13 +244,14 @@ fn timestamp_bench(
|
||||
) -> (
|
||||
Simulation,
|
||||
Address<TimestampModel>,
|
||||
EventStream<(Instant, SystemTime)>,
|
||||
EventQueue<(Instant, SystemTime)>,
|
||||
) {
|
||||
// Bench assembly.
|
||||
let mut model = TimestampModel::default();
|
||||
let mbox = Mailbox::new();
|
||||
|
||||
let stamp_stream = model.stamp.connect_stream().0;
|
||||
let stamp_stream = EventQueue::new();
|
||||
model.stamp.connect_sink(&stamp_stream);
|
||||
let addr = mbox.address();
|
||||
|
||||
let simu = SimInit::new()
|
||||
|
Reference in New Issue
Block a user