implement run() which just forwards to event loop
This commit is contained in:
parent
9e9da11f79
commit
e8b944b836
@ -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
|
||||
}
|
||||
|
||||
|
@ -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>>) {}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user