[Server] Introduce admin stream channel

This commit is contained in:
syuilo 2019-01-27 14:55:02 +09:00
parent b836528b51
commit d906d90010
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
4 changed files with 44 additions and 1 deletions

View file

@ -87,6 +87,10 @@ class Publisher {
public publishApLogStream = (log: any): void => {
this.publish('apLog', null, log);
}
public publishAdminStream = (userId: ID, type: string, value?: any): void => {
this.publish(`adminStream:${userId}`, type, typeof value === 'undefined' ? null : value);
}
}
const publisher = new Publisher();
@ -107,3 +111,4 @@ export const publishHybridTimelineStream = publisher.publishHybridTimelineStream
export const publishGlobalTimelineStream = publisher.publishGlobalTimelineStream;
export const publishHashtagStream = publisher.publishHashtagStream;
export const publishApLogStream = publisher.publishApLogStream;
export const publishAdminStream = publisher.publishAdminStream;