summaryrefslogtreecommitdiff
path: root/src/server/api/stream/channels/ap-log.ts
blob: dfa1cc702d4e94a41e7a3d06034e8cf9402dea8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import autobind from 'autobind-decorator';
import Channel from '../channel';

export default class extends Channel {
	public readonly chName = 'apLog';
	public static shouldShare = true;

	@autobind
	public async init(params: any) {
		// Subscribe events
		this.subscriber.on('apLog', this.onLog);
	}

	@autobind
	private async onLog(log: any) {
		this.send('log', log);
	}

	@autobind
	public dispose() {
		// Unsubscribe events
		this.subscriber.off('apLog', this.onLog);
	}
}