2025-03-27 07:18:19 -04:00
|
|
|
mod client;
|
2025-03-26 17:42:34 -04:00
|
|
|
mod field;
|
2025-03-29 09:22:53 -04:00
|
|
|
mod queue;
|
2025-04-02 14:26:09 -04:00
|
|
|
mod utils;
|
2024-05-05 23:18:42 -04:00
|
|
|
|
2025-04-02 14:26:09 -04:00
|
|
|
use client::{Client, ClientLink, Reply, Request};
|
2025-03-26 17:42:34 -04:00
|
|
|
use field::Field;
|
2025-03-30 11:38:41 -04:00
|
|
|
use queue::Message;
|
|
|
|
use std::sync::{
|
|
|
|
mpsc::{channel, Sender},
|
|
|
|
Arc, RwLock,
|
|
|
|
};
|
2025-02-10 08:05:59 -05:00
|
|
|
|
2025-02-22 10:53:05 -05:00
|
|
|
#[derive(Clone)]
|
2025-03-27 07:18:19 -04:00
|
|
|
pub struct MoreThanText {
|
2025-04-02 14:26:09 -04:00
|
|
|
client_link: ClientLink,
|
2025-03-30 11:38:41 -04:00
|
|
|
registry: Arc<RwLock<Vec<Sender<Message>>>>,
|
2025-03-27 07:18:19 -04:00
|
|
|
}
|
2025-02-22 10:53:05 -05:00
|
|
|
|
2025-03-26 17:42:34 -04:00
|
|
|
impl MoreThanText {
|
|
|
|
pub fn new() -> Self {
|
2025-03-30 11:38:41 -04:00
|
|
|
Self {
|
2025-04-02 14:26:09 -04:00
|
|
|
client_link: Client::start(),
|
2025-03-30 11:38:41 -04:00
|
|
|
registry: Arc::new(RwLock::new(Vec::new())),
|
|
|
|
}
|
2025-02-11 11:33:54 -05:00
|
|
|
}
|
|
|
|
|
2025-04-02 14:26:09 -04:00
|
|
|
pub fn request<F>(&mut self, _session: Option<F>) -> Reply
|
2025-02-11 11:33:54 -05:00
|
|
|
where
|
|
|
|
F: Into<Field>,
|
|
|
|
{
|
2025-04-02 14:26:09 -04:00
|
|
|
let req = Request::new();
|
|
|
|
self.client_link.forward(req)
|
|
|
|
/*
|
2025-03-27 07:18:19 -04:00
|
|
|
let req = Request::new(tx);
|
2025-04-02 14:26:09 -04:00
|
|
|
self.tx.send(req.into()).unwrap();
|
2025-03-27 07:18:19 -04:00
|
|
|
rx.recv().unwrap()
|
2025-04-02 14:26:09 -04:00
|
|
|
*/
|
2024-11-06 21:28:44 -05:00
|
|
|
}
|
2024-05-05 23:18:42 -04:00
|
|
|
}
|