Start on subscribing to messages in channel entity instances
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com> Co-Authored-By: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
co-authored by
Max Brunsfeld
Antonio Scandurra
parent
5b599a32b8
commit
541f58e12c
+5
-1
@@ -2,6 +2,7 @@ use crate::{language::LanguageRegistry, worktree::Worktree};
|
||||
use anyhow::{anyhow, Context, Result};
|
||||
use async_tungstenite::tungstenite::http::Request;
|
||||
use async_tungstenite::tungstenite::{Error as WebSocketError, Message as WebSocketMessage};
|
||||
use futures::Stream;
|
||||
use gpui::{AsyncAppContext, ModelHandle, Task, WeakModelHandle};
|
||||
use lazy_static::lazy_static;
|
||||
use smol::lock::RwLock;
|
||||
@@ -29,7 +30,6 @@ pub struct Client {
|
||||
pub struct ClientState {
|
||||
connection_id: Option<ConnectionId>,
|
||||
pub shared_worktrees: HashMap<u64, WeakModelHandle<Worktree>>,
|
||||
pub channel_list: Option<WeakModelHandle<ChannelList>>,
|
||||
pub languages: Arc<LanguageRegistry>,
|
||||
}
|
||||
|
||||
@@ -82,6 +82,10 @@ impl Client {
|
||||
});
|
||||
}
|
||||
|
||||
pub fn subscribe<T: EnvelopedMessage>(&self) -> impl Stream<Item = Arc<TypedEnvelope<T>>> {
|
||||
self.peer.subscribe()
|
||||
}
|
||||
|
||||
pub async fn log_in_and_connect(
|
||||
&self,
|
||||
router: Arc<ForegroundRouter>,
|
||||
|
||||
Reference in New Issue
Block a user