Refactor constellation broadcast channel (#38077)

- Move the 2 hash maps used to manage channels in their own struct.
- The constellation is still in charge of origin checks since it holds
the pipeline information required.
- BroadcastMsg is renamed to BroadcastChannelMsg for consistency.


Testing: covered by existing tests.
Fixes: #38060

Signed-off-by: webbeef <me@webbeef.org>
This commit is contained in:
webbeef 2025-07-15 06:57:05 -07:00 committed by GitHub
parent 34829dfce7
commit 30b6e289e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 199 additions and 198 deletions

View file

@ -74,7 +74,7 @@ impl Serializable {
/// Message for communication between the constellation and a global managing broadcast channels.
#[derive(Debug, Deserialize, Serialize)]
pub struct BroadcastMsg {
pub struct BroadcastChannelMsg {
/// The origin of this message.
pub origin: ImmutableOrigin,
/// The name of the channel.
@ -83,9 +83,9 @@ pub struct BroadcastMsg {
pub data: StructuredSerializedData,
}
impl Clone for BroadcastMsg {
fn clone(&self) -> BroadcastMsg {
BroadcastMsg {
impl Clone for BroadcastChannelMsg {
fn clone(&self) -> BroadcastChannelMsg {
BroadcastChannelMsg {
data: self.data.clone_for_broadcast(),
origin: self.origin.clone(),
channel_name: self.channel_name.clone(),