ludic.things: a fact's record kept, in two halves swapped when a fact finds the queue empty

th_fact made a ThingFact per placement, removal and use, and the valley places and removes Things
all day. The records come back two drains after they were handed out, so a reader placing a Thing
while it reads the last drain's list never sees one change (the test holds exactly that).
thing_use takes ThingsState mut, since it pushes a fact.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-28 12:33:44 +03:00
parent 22d1e2d66a
commit 8a4f3f5ad6
6 changed files with 52 additions and 12 deletions

View file

@ -52,6 +52,9 @@ away Things all day, so `thing_remove` keeps the record and `thing_put` / `thing
oldest one again - set back as new, with a new `uid` - once 32 are waiting. Hold a Thing across a
removal only by its `uid` (`thing_by_uid`), never by the record.
A fact's record (`things_facts()`) is kept too: it comes back two drains after it was handed out, so
read a drained list before the drain after next, and copy what must last longer.
## The port
Every member has a default, so any may be left out of the `bind`: