Clean up and document code throughout the server

This commit is contained in:
Lucien Greathouse
2019-01-15 12:38:31 -08:00
parent c421fd0b25
commit b87943e39d
6 changed files with 60 additions and 93 deletions

View File

@@ -19,6 +19,10 @@ pub fn get_listener_id() -> ListenerId {
ListenerId(LAST_ID.fetch_add(1, Ordering::SeqCst))
}
/// A message queue with persistent history that can be subscribed to.
///
/// Definitely non-optimal, but a simple design that works well for the
/// synchronous web server Rojo uses, Rouille.
#[derive(Default)]
pub struct MessageQueue<T> {
messages: RwLock<Vec<T>>,