Fix post-merge compile errors

This commit is contained in:
Nathan Sobo 2023-11-01 21:16:41 -06:00
parent db9ccd7f34
commit 2079cd641e
4 changed files with 18 additions and 17 deletions

View File

@ -134,7 +134,7 @@ impl Room {
}
});
let _maintain_video_tracks = cx.spawn_on_main({
let _maintain_video_tracks = cx.spawn({
let room = room.clone();
move |this, mut cx| async move {
let mut track_video_changes = room.remote_video_track_updates();
@ -153,7 +153,7 @@ impl Room {
}
});
let _maintain_audio_tracks = cx.spawn_on_main({
let _maintain_audio_tracks = cx.spawn({
let room = room.clone();
|this, mut cx| async move {
let mut track_audio_changes = room.remote_audio_track_updates();
@ -1301,7 +1301,9 @@ impl Room {
live_kit.room.unpublish_track(publication);
} else {
if muted {
cx.executor().spawn(publication.set_mute(muted)).detach();
cx.background_executor()
.spawn(publication.set_mute(muted))
.detach();
}
live_kit.microphone_track = LocalTrack::Published {
track_publication: publication,
@ -1344,7 +1346,7 @@ impl Room {
return Task::ready(Err(anyhow!("live-kit was not initialized")));
};
cx.spawn_on_main(move |this, mut cx| async move {
cx.spawn(move |this, mut cx| async move {
let publish_track = async {
let displays = displays.await?;
let display = displays
@ -1387,7 +1389,9 @@ impl Room {
live_kit.room.unpublish_track(publication);
} else {
if muted {
cx.executor().spawn(publication.set_mute(muted)).detach();
cx.background_executor()
.spawn(publication.set_mute(muted))
.detach();
}
live_kit.screen_track = LocalTrack::Published {
track_publication: publication,
@ -1454,14 +1458,11 @@ impl Room {
.remote_audio_track_publications(&participant.user.id.to_string())
{
let deafened = live_kit.deafened;
tasks.push(
cx.executor()
.spawn_on_main(move || track.set_enabled(!deafened)),
);
tasks.push(cx.foreground_executor().spawn(track.set_enabled(!deafened)));
}
}
Ok(cx.executor().spawn_on_main(|| async {
Ok(cx.foreground_executor().spawn(async move {
if let Some(mute_task) = mute_task {
mute_task.await?;
}

View File

@ -42,7 +42,7 @@ fn main() {
let live_kit_key = std::env::var("LIVE_KIT_KEY").unwrap_or("devkey".into());
let live_kit_secret = std::env::var("LIVE_KIT_SECRET").unwrap_or("secret".into());
cx.spawn_on_main(|cx| async move {
cx.spawn(|cx| async move {
let user_a_token = token::create(
&live_kit_key,
&live_kit_secret,
@ -104,7 +104,7 @@ fn main() {
}
println!("Pausing for 5 seconds to test audio, make some noise!");
let timer = cx.executor().timer(Duration::from_secs(5));
let timer = cx.background_executor().timer(Duration::from_secs(5));
timer.await;
let remote_audio_track = room_b
.remote_audio_tracks("test-participant-1")

View File

@ -2,7 +2,7 @@ use anyhow::{anyhow, Context, Result};
use async_trait::async_trait;
use collections::{BTreeMap, HashMap};
use futures::Stream;
use gpui2::Executor;
use gpui2::BackgroundExecutor;
use live_kit_server::token;
use media::core_video::CVImageBuffer;
use parking_lot::Mutex;
@ -16,7 +16,7 @@ pub struct TestServer {
pub api_key: String,
pub secret_key: String,
rooms: Mutex<HashMap<String, TestServerRoom>>,
executor: Arc<Executor>,
executor: Arc<BackgroundExecutor>,
}
impl TestServer {
@ -24,7 +24,7 @@ impl TestServer {
url: String,
api_key: String,
secret_key: String,
executor: Arc<Executor>,
executor: Arc<BackgroundExecutor>,
) -> Result<Arc<TestServer>> {
let mut servers = SERVERS.lock();
if servers.contains_key(&url) {

View File

@ -878,7 +878,7 @@ impl MultiBuffer {
cx.spawn(move |this, mut cx| async move {
let mut excerpt_ranges = Vec::new();
let mut range_counts = Vec::new();
cx.executor()
cx.background_executor()
.scoped(|scope| {
scope.spawn(async {
let (ranges, counts) =
@ -4177,7 +4177,7 @@ mod tests {
let guest_buffer = cx.build_model(|cx| {
let state = host_buffer.read(cx).to_proto();
let ops = cx
.executor()
.background_executor()
.block(host_buffer.read(cx).serialize_ops(None, cx));
let mut buffer = Buffer::from_proto(1, state, None).unwrap();
buffer