feat: change socket nomenclature + implement events provider
This commit is contained in:
parent
389c4b3ee6
commit
05e12ea2f2
5 changed files with 212 additions and 65 deletions
|
@ -1,4 +1,4 @@
|
|||
mod listeners;
|
||||
mod ipc;
|
||||
mod manager;
|
||||
mod socket;
|
||||
|
||||
|
@ -13,18 +13,21 @@ fn main() -> Result<()> {
|
|||
.init();
|
||||
let span = tracing::span!(tracing::Level::DEBUG, "main");
|
||||
let _ = span.enter();
|
||||
// spawn socket listener for niri event stream
|
||||
let (event_tx, event_rx) = smol::channel::unbounded();
|
||||
smol::spawn(listeners::event_listener(event_tx)).detach();
|
||||
// spawn socket consumer for niri event stream
|
||||
let (niri_tx, niri_rx) = smol::channel::unbounded();
|
||||
smol::spawn(ipc::event_consumer(niri_tx)).detach();
|
||||
// spawn socket listener for ipc
|
||||
let (ipc_tx, ipc_rx) = smol::channel::unbounded();
|
||||
smol::spawn(listeners::ipc_listener(ipc_tx)).detach();
|
||||
smol::spawn(ipc::ipc_provider(ipc_tx)).detach();
|
||||
// spawn socket listener for events
|
||||
let (event_tx, event_rx) = smol::channel::unbounded();
|
||||
smol::spawn(ipc::event_provider(event_rx)).detach();
|
||||
// begin managing niri tags
|
||||
smol::block_on(async {
|
||||
let niri_tag = manager::NiriTag::new()
|
||||
let niri_tag = manager::NiriTag::new(event_tx)
|
||||
.await
|
||||
.context("Initialising niri tag manager")
|
||||
.unwrap();
|
||||
niri_tag.manage_tags(event_rx, ipc_rx).await
|
||||
niri_tag.manage_tags(niri_rx, ipc_rx).await
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue