perf: 各ストリーミング接続ごとにポーリングしないように
This commit is contained in:
parent
b6d0d4eb99
commit
8050352ad8
11 changed files with 83 additions and 27 deletions
|
|
@ -20,6 +20,10 @@ class Publisher {
|
|||
}));
|
||||
}
|
||||
|
||||
public publishUserEvent = (userId: User['id'], type: string, value?: any): void => {
|
||||
this.publish(`user:${userId}`, type, typeof value === 'undefined' ? null : value);
|
||||
}
|
||||
|
||||
public publishBroadcastStream = (type: string, value?: any): void => {
|
||||
this.publish('broadcast', type, typeof value === 'undefined' ? null : value);
|
||||
}
|
||||
|
|
@ -84,6 +88,7 @@ const publisher = new Publisher();
|
|||
|
||||
export default publisher;
|
||||
|
||||
export const publishUserEvent = publisher.publishUserEvent;
|
||||
export const publishBroadcastStream = publisher.publishBroadcastStream;
|
||||
export const publishMainStream = publisher.publishMainStream;
|
||||
export const publishDriveStream = publisher.publishDriveStream;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue