mirror of
https://github.com/paricafe/misskey.git
synced 2024-11-30 04:46:43 -06:00
11 lines
385 B
TypeScript
11 lines
385 B
TypeScript
|
import * as websocket from 'websocket';
|
||
|
import * as redis from 'redis';
|
||
|
|
||
|
export default function homeStream(request: websocket.request, connection: websocket.connection, subscriber: redis.RedisClient, user: any): void {
|
||
|
// Subscribe Home stream channel
|
||
|
subscriber.subscribe(`misskey:user-stream:${user._id}`);
|
||
|
subscriber.on('message', (_, data) => {
|
||
|
connection.send(data);
|
||
|
});
|
||
|
}
|