implement run() which just forwards to event loop
This commit is contained in:
parent
9e9da11f79
commit
e8b944b836
10
src/lib.rs
10
src/lib.rs
@ -36,19 +36,15 @@ mod helpers;
|
|||||||
extern crate log;
|
extern crate log;
|
||||||
|
|
||||||
pub struct Tenquestionmarks {
|
pub struct Tenquestionmarks {
|
||||||
modules: BTreeMap<String, Box<Module>>
|
modules: BTreeMap<String, Module>
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Tenquestionmarks {
|
impl Tenquestionmarks {
|
||||||
pub fn with_modules (modules: BTreeMap<String, Box<Module>>) -> Tenquestionmarks {
|
pub fn with_modules (modules: BTreeMap<String, Module>) -> Tenquestionmarks {
|
||||||
let tqm = Tenquestionmarks {
|
let tqm = Tenquestionmarks {
|
||||||
modules: modules
|
modules: modules
|
||||||
};
|
};
|
||||||
|
|
||||||
for (_, module) in &tqm.modules {
|
|
||||||
module.register(&tqm);
|
|
||||||
}
|
|
||||||
|
|
||||||
tqm
|
tqm
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,12 @@ pub struct Module {
|
|||||||
config: Table
|
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 {
|
pub trait EventLoop : Sync {
|
||||||
fn run (&self, _: Box<ExtSender<Envelope>>, _: Receiver<Arc<Envelope>>) {}
|
fn run (&self, _: Box<ExtSender<Envelope>>, _: Receiver<Arc<Envelope>>) {}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user