1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
use crate::remote::net::StreamData;
use crate::remote::stream::pubsub::Topic;
use std::sync::Arc;

pub struct ShardingTopic {
    sharded_entity: Arc<str>,
}

pub enum ShardingEvent {
    Rebalance,
}

impl Topic for ShardingTopic {
    type Message = ShardingEvent;

    fn topic_name() -> &'static str {
        "sharding"
    }

    fn key(&self) -> String {
        format!("sharding-events-{}", &self.sharded_entity)
    }
}

impl StreamData for ShardingEvent {
    fn read_from_bytes(_data: Vec<u8>) -> Option<Self> {
        todo!()
    }

    fn write_to_bytes(&self) -> Option<Vec<u8>> {
        todo!()
    }
}