Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pixelcaliber/user-presence-service
Enables real time user-presence functionality which marks user active/inactive based on last user activity using heartbeat mechanism, received from the client (here: mouse-up mouse-down movements) and comparing it with a threshold time quantum.
https://github.com/pixelcaliber/user-presence-service
flask heartbeat-monitor kafka python redis worker-pool
Last synced: about 6 hours ago
JSON representation
Enables real time user-presence functionality which marks user active/inactive based on last user activity using heartbeat mechanism, received from the client (here: mouse-up mouse-down movements) and comparing it with a threshold time quantum.
- Host: GitHub
- URL: https://github.com/pixelcaliber/user-presence-service
- Owner: pixelcaliber
- Created: 2024-01-29T05:37:22.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2024-02-16T19:37:38.000Z (9 months ago)
- Last Synced: 2024-02-16T20:36:09.212Z (9 months ago)
- Topics: flask, heartbeat-monitor, kafka, python, redis, worker-pool
- Language: Python
- Homepage:
- Size: 14.7 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# user-presence-service
Part of chat-application microservices: Enables real time user-presence functionality which marks user active/inactive or online/offline using HEARTBEAT mechanism based on last user activity received from the client timestamp (here: mouse-up mouse-down movements) and comparing it with a threshold time quantum.
- Worker running infinitely, checking for user's last timestamp and if found more than the threshold time quantum (~10 mins) mark them as inactive in the user-presence database (here: postgres)
- Utilizes heartbeat mechinism to query for user status using pooling
- utilized redis cluster to store the last active timestamp; evicition pollicy: LRU and cache size: 100mb
- has enpoints for:
- updating user's last active timestmap in the redis cluster
- retrieving the user's last active timestamp from the redis cluster
- querying for user's active/inactive status in the database (here: postgres)tech-stack: Kafka, Redis, Postgres, Python, Flask, Postgres