Mercurial > templog
comparison rust/src/main.rs @ 616:a85c0c9bc1fa rust
hide epoch in ParamWaiter
make_request handles the buffer too
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Wed, 08 Mar 2017 23:08:14 +0800 |
parents | f153aec221be |
children | 8fda564cc46f |
comparison
equal
deleted
inserted
replaced
615:f153aec221be | 616:a85c0c9bc1fa |
---|---|
40 | 40 |
41 let mut core = Core::new().unwrap(); | 41 let mut core = Core::new().unwrap(); |
42 let handle = core.handle(); | 42 let handle = core.handle(); |
43 | 43 |
44 let params = params::Params::load(&config); | 44 let params = params::Params::load(&config); |
45 let epoch = params.epoch.clone(); | |
46 let mut fridge = fridge::Fridge::new(&config, nowait, params, &handle); | 45 let mut fridge = fridge::Fridge::new(&config, nowait, params, &handle); |
47 | 46 |
48 let (fridge_reading_s, fridge_reading_r) = mpsc::channel(1); | 47 let (fridge_reading_s, fridge_reading_r) = mpsc::channel(1); |
49 let fridge_reading_r = fridge_reading_r.map_err(|e| TemplogError::new("Problem with fridge_reading_r channel")); | 48 let fridge_reading_r = fridge_reading_r.map_err(|e| TemplogError::new("Problem with fridge_reading_r channel")); |
50 | 49 |
70 }); | 69 }); |
71 handle.spawn(t); | 70 handle.spawn(t); |
72 r | 71 r |
73 }); | 72 }); |
74 | 73 |
75 let param_stream = params::ParamWaiter::stream(config, epoch, &handle); | 74 let param_stream = params::ParamWaiter::stream(config, &handle); |
76 let p = param_stream.map(|p| { | 75 let p = param_stream.map(|p| { |
77 fridge::Message::Params(p) | 76 fridge::Message::Params(p) |
78 }); | 77 }); |
79 | 78 |
80 let timeouts = fridge.wakeups(); | 79 let timeouts = fridge.wakeups(); |