shuttlecraft
shuttlecraft copied to clipboard
Instant notifications
Added an eventemitter to notify /poll that a notification has occurred. /poll now stalls forever waiting for an event (once an event occurs, app.js repolls after 1s) Adding a notification sends the event
Rad. This is rad. Thanks.
I am testing this right now and it is mind boggling how fast it is. I will have to implement this for the DM interface too ;p
ah, one small bug - if there are unread messages already waiting, they won't show up til the first new incoming. the first request should always return current status.
Also, not sure the impact of this - but the server-side listener continues to exist even if i navigate away from the page.
I think that fixes both issues
The last few commits on here raise eyebrows - I don't really want to fire notifications for every single incoming post or dm. This will create a lot of noise in the notifications that has to be filtered out.
Instead, you could directly trigger the "check for notifications" event from those places, which would cause the longpoll to do the actual calculations...