January 2019
Intermediate to advanced
520 pages
14h 32m
English
Now, we can add a main function to spawn an actor with the decoding worker:
fn main() -> Result<(), Error> { env_logger::init(); let mut sys = System::new("rabbit-actix-worker"); let _ = QueueActor::new(WokerHandler {}, &mut sys)?; let _ = sys.run(); Ok(())}
This method starts a System and creates an instance of QueueActor with an instance of WorkerHandler. That's all. It's really simple—with QueueActor, it's enough to implement QueueHandler to make a processor to a queue. Let's create a server in a similar way.
Read now
Unlock full access