Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix overseer example
  • Loading branch information
expenses committed Jun 2, 2020
commit 83cb55ae9f9549ca521f1ace94867282d3e9f77b
11 changes: 11 additions & 0 deletions overseer/examples/minimal-example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,16 @@ impl Subsystem<ValidationSubsystemMessage> for Subsystem2 {
}
}


struct DummySubsystem;

impl<M: std::fmt::Debug> Subsystem<M> for DummySubsystem {
fn start(&mut self, _: SubsystemContext<M>) -> SpawnedSubsystem {
SpawnedSubsystem(Box::pin(Delay::new(Duration::from_secs(10))))
}
}


fn main() {
femme::with_level(femme::LevelFilter::Trace);
let spawner = executor::ThreadPool::new().unwrap();
Expand All @@ -113,6 +123,7 @@ fn main() {
let (overseer, _handler) = Overseer::new(
Box::new(Subsystem2),
Box::new(Subsystem1),
Box::new(DummySubsystem),
spawner,
).unwrap();
let overseer_fut = overseer.run().fuse();
Expand Down