Split out a foreground and background executor
This commit is contained in:
parent
dd1a2a9e44
commit
11b6d9e33a
26 changed files with 165 additions and 150 deletions
|
@ -559,7 +559,7 @@ async fn test_outline(cx: &mut gpui2::TestAppContext) {
|
|||
cx: &'a gpui2::TestAppContext,
|
||||
) -> Vec<(&'a str, Vec<usize>)> {
|
||||
let matches = cx
|
||||
.update(|cx| outline.search(query, cx.executor().clone()))
|
||||
.update(|cx| outline.search(query, cx.background_executor().clone()))
|
||||
.await;
|
||||
matches
|
||||
.into_iter()
|
||||
|
@ -1879,7 +1879,7 @@ fn test_serialization(cx: &mut gpui2::AppContext) {
|
|||
|
||||
let state = buffer1.read(cx).to_proto();
|
||||
let ops = cx
|
||||
.executor()
|
||||
.background_executor()
|
||||
.block(buffer1.read(cx).serialize_ops(None, cx));
|
||||
let buffer2 = cx.build_model(|cx| {
|
||||
let mut buffer = Buffer::from_proto(1, state, None).unwrap();
|
||||
|
@ -1921,7 +1921,7 @@ fn test_random_collaboration(cx: &mut AppContext, mut rng: StdRng) {
|
|||
let buffer = cx.build_model(|cx| {
|
||||
let state = base_buffer.read(cx).to_proto();
|
||||
let ops = cx
|
||||
.executor()
|
||||
.background_executor()
|
||||
.block(base_buffer.read(cx).serialize_ops(None, cx));
|
||||
let mut buffer = Buffer::from_proto(i as ReplicaId, state, None).unwrap();
|
||||
buffer
|
||||
|
@ -2025,7 +2025,9 @@ fn test_random_collaboration(cx: &mut AppContext, mut rng: StdRng) {
|
|||
}
|
||||
50..=59 if replica_ids.len() < max_peers => {
|
||||
let old_buffer_state = buffer.read(cx).to_proto();
|
||||
let old_buffer_ops = cx.executor().block(buffer.read(cx).serialize_ops(None, cx));
|
||||
let old_buffer_ops = cx
|
||||
.background_executor()
|
||||
.block(buffer.read(cx).serialize_ops(None, cx));
|
||||
let new_replica_id = (0..=replica_ids.len() as ReplicaId)
|
||||
.filter(|replica_id| *replica_id != buffer.read(cx).replica_id())
|
||||
.choose(&mut rng)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue