Move operation serialization off the main thread

This commit is contained in:
Antonio Scandurra 2022-08-23 16:34:25 +02:00
parent 954695f5fe
commit f0d35ccc50
5 changed files with 57 additions and 39 deletions

View file

@ -3304,7 +3304,10 @@ mod tests {
fn test_remote_multibuffer(cx: &mut MutableAppContext) {
let host_buffer = cx.add_model(|cx| Buffer::new(0, "a", cx));
let guest_buffer = cx.add_model(|cx| {
let (state, ops) = host_buffer.read(cx).to_proto();
let state = host_buffer.read(cx).to_proto();
let ops = cx
.background()
.block(host_buffer.read(cx).serialize_ops(cx));
let mut buffer = Buffer::from_proto(1, state, None).unwrap();
buffer
.apply_ops(