Guest User

Untitled

a guest
May 21st, 2018
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. fu.get("/latest_message", function (req, res) {
  2. var since = parseInt(qs.parse(url.parse(req.url).query).since);
  3.  
  4. if(since < latestMessageReceived) // new message since client last requested
  5. sendLatestMessageToClient(res); // send it straight to them
  6. else
  7. messageRequests.push({ callback: sendLatestMessageToClient, res: res }); // queue up the requst
  8. });
Add Comment
Please, Sign In to add comment