feat: socket clients/intercom

This commit is contained in:
cha0s 2020-12-09 22:06:53 -06:00
parent 119835fb0d
commit d4b8af601d

View File

@ -20,6 +20,12 @@ export default {
'@latus/user/session': (latus) => ({ '@latus/user/session': (latus) => ({
store: new RedisStore({client: createClient(latus)}), store: new RedisStore({client: createClient(latus)}),
}), }),
'@latus/socket/connect': ({req}) => {
const {adapter} = req;
const customRequest = promisify(adapter.customRequest.bind(req.adapter));
req.intercom = (type, payload) => customRequest(type, payload);
req.clients = promisify(adapter.clients.bind(adapter));
},
'@latus/socket/server': (latus) => { '@latus/socket/server': (latus) => {
const pubClient = createClient(latus); const pubClient = createClient(latus);
const subClient = createClient(latus); const subClient = createClient(latus);