mirror of
https://github.com/girlbossceo/conduwuit.git
synced 2025-12-16 20:29:00 -05:00
shard sender into multiple task workers by destination hash
rename Destination::Normal variant tracing instruments Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
98e6c81e49
commit
af3d6a2e37
9 changed files with 275 additions and 95 deletions
|
|
@ -7,14 +7,14 @@ use ruma::{OwnedServerName, OwnedUserId};
|
|||
pub enum Destination {
|
||||
Appservice(String),
|
||||
Push(OwnedUserId, String), // user and pushkey
|
||||
Normal(OwnedServerName),
|
||||
Federation(OwnedServerName),
|
||||
}
|
||||
|
||||
#[implement(Destination)]
|
||||
#[must_use]
|
||||
pub(super) fn get_prefix(&self) -> Vec<u8> {
|
||||
match self {
|
||||
| Self::Normal(server) => {
|
||||
| Self::Federation(server) => {
|
||||
let len = server.as_bytes().len().saturating_add(1);
|
||||
|
||||
let mut p = Vec::with_capacity(len);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue