fed-sx-m1: Step 4b-proj — 7 bootstrap projections + manifest update + 9 new parse tests (31 total)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 35s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 35s
This commit is contained in:
15
next/genesis/projections/by-actor.sx
Normal file
15
next/genesis/projections/by-actor.sx
Normal file
@@ -0,0 +1,15 @@
|
||||
;; next/genesis/projections/by-actor.sx
|
||||
;;
|
||||
;; Index of activity CIDs grouped by :actor. Maps actor-id to a
|
||||
;; list of CIDs in append order. Powers the per-actor outbox
|
||||
;; listing (Step 8) without re-scanning the full log.
|
||||
|
||||
(DefineProjection
|
||||
:name "by-actor"
|
||||
:doc "Actor-id -> list of activity CIDs (append order)."
|
||||
:initial-state {}
|
||||
:fold (fn
|
||||
(state act)
|
||||
(let
|
||||
((a (-> act :actor)) (cid (-> act :cid)))
|
||||
(assoc state a (append (or (get state a) (list)) (list cid))))))
|
||||
Reference in New Issue
Block a user