huskies: merge 1163 story Replace perm_rx lock-as-presence-signal with a permission router
This commit is contained in:
@@ -263,9 +263,9 @@ impl BotContext {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::service::permission_router::{PendingPermReplies, ResponderRegistry};
|
||||
use std::collections::HashMap;
|
||||
use std::path::PathBuf;
|
||||
use tokio::sync::mpsc;
|
||||
|
||||
fn make_user_id(s: &str) -> OwnedUserId {
|
||||
s.parse().unwrap()
|
||||
@@ -273,15 +273,14 @@ mod tests {
|
||||
|
||||
/// Build a test `Services` bundle with the given project root.
|
||||
fn test_services(project_root: PathBuf) -> Arc<Services> {
|
||||
let (_perm_tx, perm_rx) = mpsc::unbounded_channel();
|
||||
Arc::new(Services {
|
||||
project_root,
|
||||
agents: Arc::new(crate::agents::AgentPool::new_test(3000)),
|
||||
bot_name: "Assistant".to_string(),
|
||||
bot_user_id: "@bot:example.com".to_string(),
|
||||
ambient_rooms: Arc::new(std::sync::Mutex::new(std::collections::HashSet::new())),
|
||||
perm_rx: Arc::new(TokioMutex::new(perm_rx)),
|
||||
pending_perm_replies: Arc::new(TokioMutex::new(HashMap::new())),
|
||||
permission_registry: ResponderRegistry::new(),
|
||||
pending_perm_replies: PendingPermReplies::new(),
|
||||
permission_timeout_secs: 120,
|
||||
status: Arc::new(crate::service::status::StatusBroadcaster::new()),
|
||||
chat_dispatcher: Arc::new(crate::chat::dispatcher::ChatDispatcher::new(1_500)),
|
||||
|
||||
Reference in New Issue
Block a user