#![feature(proc_macro_non_items, proc_macro_gen, decl_macro)] #[macro_use] extern crate rocket; extern crate crossbeam; #[cfg(test)] mod tests; use rocket::State; use crossbeam::queue::MsQueue; struct LogChannel(MsQueue); #[put("/push?")] fn push(event: String, queue: State) { queue.0.push(event); } #[get("/pop")] fn pop(queue: State) -> String { queue.0.pop() } fn rocket() -> rocket::Rocket { rocket::ignite() .mount("/", routes![push, pop]) .manage(LogChannel(MsQueue::new())) } fn main() { rocket().launch(); }