You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a developer interested to working with users, that might be connected from many devices (also, on different server instances if server is scaled), service has to give approach, that will encapsulate this.
Connection and user instance has to be available from req var.
example of user instance:
app.use((req,res,next)=>{req.user.push({message: 'single message from server',})})
example of connection instance:
app.use((req,res,next)=>{req.connection.push({message: 'single message from server for only current connection',})})
availability of user from API:
app.use((req,res,next)=>{letsomeUserId=25;req.socket.user(someUserId).push({message: 'single message from server for only current connection',})})
The text was updated successfully, but these errors were encountered:
As a developer interested to working with users, that might be connected from many devices (also, on different server instances if server is scaled), service has to give approach, that will encapsulate this.
Connection and user instance has to be available from
req
var.example of user instance:
example of connection instance:
availability of user from API:
The text was updated successfully, but these errors were encountered: