Skip to content

Commit

Permalink
broadcast
Browse files Browse the repository at this point in the history
  • Loading branch information
hashwarp committed Jan 5, 2025
1 parent a816a9b commit ee6cfb0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/realm-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,20 @@ export class RealmServer implements Realm.Service {
}
}

async broadcast(
input: Realm.RouterInput['broadcast'],
{ client }: Realm.ServiceContext
): Promise<Realm.RouterOutput['broadcast']> {
if (!input) throw new Error('Input should not be void');

// TODO: call seer
// this.seer.emit.banUser.mutate(input);

for (const shardId of Object.keys(this.shards)) {
await this.shards[shardId].emit.broadcast.mutate(input);
}
}

async banUser(
input: Realm.RouterInput['banUser'],
{ client }: Realm.ServiceContext
Expand Down

0 comments on commit ee6cfb0

Please sign in to comment.