Fixed lost sender issue.

This commit is contained in:
2025-03-30 11:38:41 -04:00
parent f8bf13e91b
commit c3f24d58c3
3 changed files with 51 additions and 56 deletions

View File

@ -4,17 +4,25 @@ mod queue;
use client::{Client, Reply, Request};
use field::Field;
use std::sync::mpsc::{channel, Sender};
use queue::Message;
use std::sync::{
mpsc::{channel, Sender},
Arc, RwLock,
};
#[derive(Clone)]
pub struct MoreThanText {
registry: Arc<RwLock<Vec<Sender<Message>>>>,
tx: Sender<Request>,
}
impl MoreThanText {
pub fn new() -> Self {
let tx = Client::start();
Self { tx: tx }
Self {
registry: Arc::new(RwLock::new(Vec::new())),
tx: tx,
}
}
pub fn request<F>(&self, _session: Option<F>) -> Reply