Refactor ssh remoting - make ChannelClient type private (#36514)

This PR is one step in a series of refactors to prepare for having
"remote" projects that do not use SSH. The main use cases for this are
WSL and dev containers.

Release Notes:

- N/A
This commit is contained in:
Max Brunsfeld 2025-08-19 17:33:56 -07:00 committed by GitHub
parent 82ac8a8aaa
commit ce216432be
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 133 additions and 146 deletions

View file

@ -315,4 +315,23 @@ impl AnyProtoClient {
}),
);
}
pub fn subscribe_to_entity<E: 'static>(&self, remote_id: u64, entity: &Entity<E>) {
let id = (TypeId::of::<E>(), remote_id);
let mut message_handlers = self.0.message_handler_set().lock();
if message_handlers
.entities_by_type_and_remote_id
.contains_key(&id)
{
panic!("already subscribed to entity");
}
message_handlers.entities_by_type_and_remote_id.insert(
id,
EntityMessageSubscriber::Entity {
handle: entity.downgrade().into(),
},
);
}
}