Skip to content
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.

Commit

Permalink
named notifications loop thread
Browse files Browse the repository at this point in the history
  • Loading branch information
khodzha committed Jun 8, 2020
1 parent 2b21bba commit a0fa253
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,16 @@ pub(crate) async fn run(db: &ConnectionPool, authz_cache: Option<AuthzCache>) ->
// Event loop for incoming messages of MQTT Agent
let (mq_tx, mut mq_rx) = futures_channel::mpsc::unbounded::<AgentNotification>();

thread::spawn(move || {
for message in rx {
if let Err(_) = mq_tx.unbounded_send(message) {
error!("Error sending message to the internal channel");
thread::Builder::new()
.name("conference-notifications-loop".to_owned())
.spawn(move || {
for message in rx {
if let Err(_) = mq_tx.unbounded_send(message) {
error!("Error sending message to the internal channel");
}
}
}
});
})
.expect("Failed to start conference notifications loop");

// Authz
let authz = svc_authz::ClientMap::new(&config.id, authz_cache, config.authz.clone())
Expand Down

0 comments on commit a0fa253

Please sign in to comment.