swindon-rs / swindon

An HTTP edge (frontend) server with smart websockets support
Apache License 2.0
101 stars 9 forks source link

Passive user activity tracking #50

Open tailhook opened 7 years ago

tailhook commented 7 years ago

Usually, we use active field in any request to keep treating user active.

While it's fine for applications that are inherently chat rooms (i.e. the whole time spent on a page is reading messages and writing them, both of which send some calls to backend), it's not for applications where primary tasks are not done via websockets.

So we should introduce a special call swindon.activity that is basically a no-op, but updates activity tracker.

Note: you shouldn't call it on a timer (we already have pings, and know when connection is active and working fine), but rather when some user action is done. I.e. if user activated a window, clicked anything, moved a mouse, touched a page...