1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-09-15 19:26:58 +02:00

refactor: replace channel macros with ext trait methods

This commit is contained in:
Jake Stanger 2025-05-18 15:17:09 +01:00
commit f929aef2d9
No known key found for this signature in database
GPG key ID: C51FC8F9CB0BEA61
50 changed files with 658 additions and 476 deletions

View file

@ -13,11 +13,11 @@ use tokio::net::{UnixListener, UnixStream};
use tokio::sync::mpsc::{self, Receiver, Sender};
use tracing::{debug, error, info, warn};
use super::Ipc;
use crate::channels::{AsyncSenderExt, MpscReceiverExt};
use crate::ipc::{Command, Response};
use crate::style::load_css;
use crate::{Ironbar, glib_recv_mpsc, send_async, spawn, try_send};
use super::Ipc;
use crate::{Ironbar, spawn};
impl Ipc {
/// Starts the IPC server on its socket.
@ -66,9 +66,9 @@ impl Ipc {
});
let application = application.clone();
glib_recv_mpsc!(cmd_rx, command => {
cmd_rx.recv_glib(move |command| {
let res = Self::handle_command(command, &application, &ironbar);
try_send!(res_tx, res);
res_tx.send_spawn(res);
});
}
@ -91,7 +91,7 @@ impl Ipc {
debug!("Received command: {command:?}");
send_async!(cmd_tx, command);
cmd_tx.send_expect(command).await;
let res = res_rx
.recv()
.await