Make swssion pass on any additional information.

This commit is contained in:
2025-04-15 09:53:38 -04:00
parent 744f2077f4
commit a5b4398eab
6 changed files with 105 additions and 50 deletions

View File

@ -1,7 +1,4 @@
use crate::{
field::Field,
queue::{Message, MsgType, Queue},
};
use crate::queue::{Message, MsgType, Queue};
use std::{
sync::mpsc::{channel, Receiver},
thread::spawn,
@ -9,7 +6,7 @@ use std::{
const RESPONDS_TO: [MsgType; 1] = [MsgType::DocumentRequest];
struct Document {
pub struct Document {
queue: Queue,
rx: Receiver<Message>,
}
@ -70,9 +67,9 @@ mod documents {
queue.send(msg.clone()).unwrap();
let reply = rx.recv_timeout(TIMEOUT).unwrap();
assert_eq!(reply.get_id(), msg.get_id());
match reply.get_class() {
match reply.get_msg_type() {
MsgType::Document => {}
_ => unreachable!("got {:?} should have gotten document", msg.get_class()),
_ => unreachable!("got {:?} should have gotten document", msg.get_msg_type()),
}
assert_eq!(reply.get_data("sess_id").unwrap().to_uuid().unwrap(), id);
assert!(reply.get_data("doc").is_some());