History

Fix post-merge compile errors

Nathan Sobo committed 3 years ago

Commit 2079cd61 parent db9ccd74 files · +18 −17Browse files

Unified · Split

4 files
  1. crates/call2/src/room.rs +11 −10
  2. crates/live_kit_client2/examples/test_app.rs +2 −2
  3. crates/live_kit_client2/src/test.rs +3 −3
  4. crates/multi_buffer2/src/multi_buffer2.rs +2 −2
crates/call2/src/room.rs+11−10
@@ -134,7 +134,7 @@ impl Room { · 133 unmodified lines
134134 }
135135 });
136136
137− let _maintain_video_tracks = cx.spawn_on_main({
137+ let _maintain_video_tracks = cx.spawn({
138138 let room = room.clone();
139139 move |this, mut cx| async move {
140140 let mut track_video_changes = room.remote_video_track_updates();
@@ -153,7 +153,7 @@ impl Room { · 12 unmodified lines
153153 }
154154 });
155155
156− let _maintain_audio_tracks = cx.spawn_on_main({
156+ let _maintain_audio_tracks = cx.spawn({
157157 let room = room.clone();
158158 |this, mut cx| async move {
159159 let mut track_audio_changes = room.remote_audio_track_updates();
@@ -1301,7 +1301,9 @@ impl Room { · 1141 unmodified lines
13011301 live_kit.room.unpublish_track(publication);
13021302 } else {
13031303 if muted {
1304− cx.executor().spawn(publication.set_mute(muted)).detach();
1304+ cx.background_executor()
1305+ .spawn(publication.set_mute(muted))
1306+ .detach();
13051307 }
13061308 live_kit.microphone_track = LocalTrack::Published {
13071309 track_publication: publication,
@@ -1344,7 +1346,7 @@ impl Room { · 36 unmodified lines
13441346 return Task::ready(Err(anyhow!("live-kit was not initialized")));
13451347 };
13461348
1347− cx.spawn_on_main(move |this, mut cx| async move {
1349+ cx.spawn(move |this, mut cx| async move {
13481350 let publish_track = async {
13491351 let displays = displays.await?;
13501352 let display = displays
@@ -1387,7 +1389,9 @@ impl Room { · 36 unmodified lines
13871389 live_kit.room.unpublish_track(publication);
13881390 } else {
13891391 if muted {
1390− cx.executor().spawn(publication.set_mute(muted)).detach();
1392+ cx.background_executor()
1393+ .spawn(publication.set_mute(muted))
1394+ .detach();
13911395 }
13921396 live_kit.screen_track = LocalTrack::Published {
13931397 track_publication: publication,
@@ -1454,14 +1458,11 @@ impl Room { · 60 unmodified lines
14541458 .remote_audio_track_publications(&participant.user.id.to_string())
14551459 {
14561460 let deafened = live_kit.deafened;
1457− tasks.push(
1458− cx.executor()
1459− .spawn_on_main(move || track.set_enabled(!deafened)),
1460− );
1461+ tasks.push(cx.foreground_executor().spawn(track.set_enabled(!deafened)));
14611462 }
14621463 }
14631464
1464− Ok(cx.executor().spawn_on_main(|| async {
1465+ Ok(cx.foreground_executor().spawn(async move {
14651466 if let Some(mute_task) = mute_task {
14661467 mute_task.await?;
14671468 }
crates/live_kit_client2/examples/test_app.rs+2−2
@@ -42,7 +42,7 @@ fn main() { · 41 unmodified lines
4242 let live_kit_key = std::env::var("LIVE_KIT_KEY").unwrap_or("devkey".into());
4343 let live_kit_secret = std::env::var("LIVE_KIT_SECRET").unwrap_or("secret".into());
4444
45− cx.spawn_on_main(|cx| async move {
45+ cx.spawn(|cx| async move {
4646 let user_a_token = token::create(
4747 &live_kit_key,
4848 &live_kit_secret,
@@ -104,7 +104,7 @@ fn main() { · 55 unmodified lines
104104 }
105105
106106 println!("Pausing for 5 seconds to test audio, make some noise!");
107− let timer = cx.executor().timer(Duration::from_secs(5));
107+ let timer = cx.background_executor().timer(Duration::from_secs(5));
108108 timer.await;
109109 let remote_audio_track = room_b
110110 .remote_audio_tracks("test-participant-1")
crates/live_kit_client2/src/test.rs+3−3
@@ -2,7 +2,7 @@ use anyhow::{anyhow, Context, Result}; · 1 unmodified line
22 use async_trait::async_trait;
33 use collections::{BTreeMap, HashMap};
44 use futures::Stream;
5−use gpui2::Executor;
5+use gpui2::BackgroundExecutor;
66 use live_kit_server::token;
77 use media::core_video::CVImageBuffer;
88 use parking_lot::Mutex;
@@ -16,7 +16,7 @@ pub struct TestServer { · 7 unmodified lines
1616 pub api_key: String,
1717 pub secret_key: String,
1818 rooms: Mutex<HashMap<String, TestServerRoom>>,
19− executor: Arc<Executor>,
19+ executor: Arc<BackgroundExecutor>,
2020 }
2121
2222 impl TestServer {
@@ -24,7 +24,7 @@ impl TestServer { · 1 unmodified line
2424 url: String,
2525 api_key: String,
2626 secret_key: String,
27− executor: Arc<Executor>,
27+ executor: Arc<BackgroundExecutor>,
2828 ) -> Result<Arc<TestServer>> {
2929 let mut servers = SERVERS.lock();
3030 if servers.contains_key(&url) {
crates/multi_buffer2/src/multi_buffer2.rs+2−2
@@ -878,7 +878,7 @@ impl MultiBuffer { · 877 unmodified lines
878878 cx.spawn(move |this, mut cx| async move {
879879 let mut excerpt_ranges = Vec::new();
880880 let mut range_counts = Vec::new();
881− cx.executor()
881+ cx.background_executor()
882882 .scoped(|scope| {
883883 scope.spawn(async {
884884 let (ranges, counts) =
@@ -4177,7 +4177,7 @@ mod tests { · 3292 unmodified lines
41774177 let guest_buffer = cx.build_model(|cx| {
41784178 let state = host_buffer.read(cx).to_proto();
41794179 let ops = cx
4180− .executor()
4180+ .background_executor()
41814181 .block(host_buffer.read(cx).serialize_ops(None, cx));
41824182 let mut buffer = Buffer::from_proto(1, state, None).unwrap();
41834183 buffer

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t