587
|
1 extern crate robots; |
|
2 |
|
3 mod sensor; |
|
4 |
|
5 use std::sync::Arc; |
|
6 use std::time::Duration; |
|
7 |
|
8 use robots::actors::{Actor, ActorSystem, ActorCell, ActorContext, Props}; |
|
9 |
|
10 fn main() { |
|
11 println!("Wort Templog"); |
|
12 let actor_system = ActorSystem::new("templog".to_string()); |
|
13 |
|
14 let props = Props::new(Arc::new(sensor::Sensor::new), ()); |
|
15 let sensor = actor_system.actor_of(props, "sensor".to_string()); |
|
16 |
|
17 actor_system.tell(sensor, "yeah".to_string()); |
|
18 |
|
19 std::thread::sleep(Duration::from_millis(100)); |
|
20 actor_system.shutdown(); |
|
21 |
|
22 |
|
23 } |
|
24 |