jabyrd3 / typeto.me2

Successor to typeto.me
8 stars 3 forks source link

rework persistence #15

Open jabyrd3 opened 7 months ago

jabyrd3 commented 7 months ago

rooms.json is fine-enough for a while but its going to be a bottleneck if too many people use this at once

there's no reason to have it all in the same file, and i don't like the fake locking mechanism i wanged together

each room should be responsible for writing its own cached representation to disk (after a very-short period of inactivity via debounce, or with a 10s interval if a debounced write hasn't been able to complete)

dir structure can be like:

rooms
  a2efawe3 (roomid)
     12fas23f..af23 (socketid, plaintext messages)
     someothersocket
  e23io323 (roomid)
     socketid
     socketid