implement run() which just forwards to event loop

This commit is contained in:
Adrian Malacoda 2017-05-09 22:48:04 -05:00
parent 9e9da11f79
commit e8b944b836
2 changed files with 9 additions and 8 deletions

View File

@ -36,19 +36,15 @@ mod helpers;
extern crate log;
pub struct Tenquestionmarks {
modules: BTreeMap<String, Box<Module>>
modules: BTreeMap<String, Module>
}
impl Tenquestionmarks {
pub fn with_modules (modules: BTreeMap<String, Box<Module>>) -> Tenquestionmarks {
pub fn with_modules (modules: BTreeMap<String, Module>) -> Tenquestionmarks {
let tqm = Tenquestionmarks {
modules: modules
};
for (_, module) in &tqm.modules {
module.register(&tqm);
}
tqm
}

View File

@ -24,7 +24,12 @@ pub struct Module {
config: Table
}
impl Module {}
impl Module {
pub fn run (&self, sender: Box<ExtSender<Envelope>>, receiver: Receiver<Arc<Envelope>>) {
self.event_loop.run(sender, receiver);
}
}
pub trait EventLoop : Sync {
fn run (&self, _: Box<ExtSender<Envelope>>, _: Receiver<Arc<Envelope>>) {}
}