mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-07-02 03:01:04 +02:00
Merge pull request #409 from JakeStanger/fix/tokio-spawn
Fix script crash
This commit is contained in:
commit
cfa1fceee5
2 changed files with 5 additions and 6 deletions
|
@ -3,7 +3,7 @@ mod wl_output;
|
||||||
mod wl_seat;
|
mod wl_seat;
|
||||||
|
|
||||||
use crate::error::ERR_CHANNEL_RECV;
|
use crate::error::ERR_CHANNEL_RECV;
|
||||||
use crate::{arc_mut, lock, register_client, send, Ironbar};
|
use crate::{arc_mut, lock, register_client, send, spawn, spawn_blocking};
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
|
|
||||||
use calloop_channel::Event::Msg;
|
use calloop_channel::Event::Msg;
|
||||||
|
@ -132,7 +132,7 @@ impl Client {
|
||||||
#[cfg(feature = "clipboard")]
|
#[cfg(feature = "clipboard")]
|
||||||
let clipboard_channel = broadcast::channel(32);
|
let clipboard_channel = broadcast::channel(32);
|
||||||
|
|
||||||
Ironbar::runtime().spawn_blocking(move || {
|
spawn_blocking(move || {
|
||||||
Environment::spawn(event_tx, request_rx, response_tx);
|
Environment::spawn(event_tx, request_rx, response_tx);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -145,8 +145,7 @@ impl Client {
|
||||||
#[cfg(feature = "clipboard")]
|
#[cfg(feature = "clipboard")]
|
||||||
let clipboard_tx = clipboard_channel.0.clone();
|
let clipboard_tx = clipboard_channel.0.clone();
|
||||||
|
|
||||||
let rt = Ironbar::runtime();
|
spawn(async move {
|
||||||
rt.spawn(async move {
|
|
||||||
while let Some(event) = event_rx.recv().await {
|
while let Some(event) = event_rx.recv().await {
|
||||||
match event {
|
match event {
|
||||||
Event::Output(event) => send!(output_tx, event),
|
Event::Output(event) => send!(output_tx, event),
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use crate::send_async;
|
use crate::{send_async, spawn};
|
||||||
use color_eyre::eyre::WrapErr;
|
use color_eyre::eyre::WrapErr;
|
||||||
use color_eyre::{Report, Result};
|
use color_eyre::{Report, Result};
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
|
@ -7,9 +7,9 @@ use std::fmt::{Display, Formatter};
|
||||||
use std::process::Stdio;
|
use std::process::Stdio;
|
||||||
use tokio::io::{AsyncBufReadExt, BufReader};
|
use tokio::io::{AsyncBufReadExt, BufReader};
|
||||||
use tokio::process::Command;
|
use tokio::process::Command;
|
||||||
|
use tokio::select;
|
||||||
use tokio::sync::mpsc;
|
use tokio::sync::mpsc;
|
||||||
use tokio::time::sleep;
|
use tokio::time::sleep;
|
||||||
use tokio::{select, spawn};
|
|
||||||
use tracing::{debug, error, trace, warn};
|
use tracing::{debug, error, trace, warn};
|
||||||
|
|
||||||
#[derive(Debug, Deserialize, Clone)]
|
#[derive(Debug, Deserialize, Clone)]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue