Flatchat Code Talk
Published Thursday, September 29, 2016
Flatchat is our in-house replacement for Slack, which we’ll be moving our users off soon.
Stats
- maxing out at ~350-500 unique websockets
- avg 200ms room load time
Check /pghero
for db query diagnostics.
ssh into flatchat server for PM2 monitoring.
- logs are rolled over every 7 days
pm2 monit
for live resource usagepm2 list
for quick summary
Handling Message
- Validate inputs (flatchatter and room member)
- Check room policy
- Write message to db
- Add more stuff to message object (decorator?)
- Broadcast msg
- to other users in room
- to other rooms
- Send msg info to rabbitmq for processing
Details:
- Room stored in session
- User bounced if no access to room / no room