Put back worktree_id in CloseFile and OpenBuffer messages

This commit is contained in:
Antonio Scandurra
2021-06-21 14:44:01 +02:00
parent 2905ce3ba7
commit 95024c616e
3 changed files with 40 additions and 4 deletions
+22
View File
@@ -310,6 +310,28 @@ impl Peer {
}
}
pub fn forward_send<T: EnvelopedMessage>(
self: &Arc<Self>,
sender_id: ConnectionId,
receiver_id: ConnectionId,
message: T,
) -> impl Future<Output = Result<()>> {
let this = self.clone();
async move {
let connection = this.connection(receiver_id).await?;
let message_id = connection
.next_message_id
.fetch_add(1, atomic::Ordering::SeqCst);
connection
.writer
.lock()
.await
.write_message(&message.into_envelope(message_id, None, Some(sender_id.0)))
.await?;
Ok(())
}
}
pub fn respond<T: RequestMessage>(
self: &Arc<Self>,
receipt: Receipt<T>,