Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

Switch frame channel from flume to tokio broadcast

Richie McIlroy7c6883112210
diff --git a/apps/desktop/src-tauri/src/editor_window.rs b/apps/desktop/src-tauri/src/editor_window.rs
index 7c253d595..4f616c1d2 100644
--- a/apps/desktop/src-tauri/src/editor_window.rs
+++ b/apps/desktop/src-tauri/src/editor_window.rs
@@ -1,6 +1,6 @@
use std::{collections::HashMap, ops::Deref, path::PathBuf, sync::Arc};
use tauri::{Manager, Runtime, Window, ipc::CommandArg};
-use tokio::sync::RwLock;
+use tokio::sync::{RwLock, broadcast};
use tokio_util::sync::CancellationToken;
use crate::{
@@ -88,9 +88,9 @@ impl EditorInstances {
match instances.entry(window.label().to_string()) {
Entry::Vacant(entry) => {
- let (frame_tx, frame_rx) = flume::bounded(4);
+ let (frame_tx, _) = broadcast::channel(4);
- let (ws_port, ws_shutdown_token) = create_frame_ws(frame_rx).await;
+ let (ws_port, ws_shutdown_token) = create_frame_ws(frame_tx.clone()).await;
let instance = create_editor_instance_impl(
window.app_handle(),
path,