forked from rojo-rbx/rojo
Glue message queue onto ServeSession, simplify some HTTP
This commit is contained in:
@@ -1,22 +1,27 @@
|
||||
use std::collections::HashSet;
|
||||
|
||||
use crate::{project::Project, session_id::SessionId, snapshot::RojoTree};
|
||||
use crate::{
|
||||
message_queue::MessageQueue, project::Project, session_id::SessionId, snapshot::RojoTree,
|
||||
};
|
||||
|
||||
/// Contains all of the state for a Rojo serve session.
|
||||
pub struct ServeSession {
|
||||
root_project: Option<Project>,
|
||||
session_id: SessionId,
|
||||
tree: RojoTree,
|
||||
message_queue: MessageQueue<()>, // TODO: Real message type
|
||||
}
|
||||
|
||||
impl ServeSession {
|
||||
pub fn new(tree: RojoTree, root_project: Option<Project>) -> ServeSession {
|
||||
let session_id = SessionId::new();
|
||||
let message_queue = MessageQueue::new();
|
||||
|
||||
ServeSession {
|
||||
session_id,
|
||||
root_project,
|
||||
tree,
|
||||
message_queue,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +29,10 @@ impl ServeSession {
|
||||
&self.tree
|
||||
}
|
||||
|
||||
pub fn message_queue(&self) -> &MessageQueue<()> {
|
||||
&self.message_queue
|
||||
}
|
||||
|
||||
pub fn session_id(&self) -> SessionId {
|
||||
self.session_id
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user