textual-engine icon indicating copy to clipboard operation
textual-engine copied to clipboard

prune old rooms from state

Open ssube opened this issue 4 years ago • 1 comments
trafficstars

Remove old rooms from the state struct when it reaches the configured limit. Remove the oldest rooms first, by visitation time/turn.

ssube avatar May 13 '21 18:05 ssube

This should be handled with an ordered and limited-size list of visited IDs in the state service. When focus changes, add to the list, and remove items that exceed the limit. When items are removed, remove the corresponding rooms (with actors and items) from state. Ensure they will no longer receive script events or be written into the state file, and are eligible for GC.

ssube avatar May 23 '21 18:05 ssube