Repository navigation
Adds projector process and multi-node guide - #122
Merged
Merged
Conversation
The jobs-and-projectors guide gains Step 5: the projector as a handler process of its own, which reads the scope off the event for a write and, for a read-back by id, off the row's own plaintext library_id column first and then loads the row under it. A process dictionary crosses neither a process nor a node, so nothing else is read. A new "On more than one node" section says the default suspension store is per node and points at Encryptor.Ecto.SuspensionStore and the vault's :suspension_poll_interval. The guide test compiles both new blocks and runs the handler against events from two libraries sent from processes with and without a scope. Docs and test only; no library change and no fragment. Refs: ece-1lkx
johnnyt
force-pushed
the
ece-1lkx-projector-process-and-multi-node
branch
from
September 30, 2026 06:08
ff98ce8 to
523ecd7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs: ece-1lkx
What changes
docs/guides/scope-in-jobs-and-projectors.mdgains two sections, in the guide's own library-catalog host:project/1, unchanged), and for a read-back by id off the row's own plaintextlibrary_idcolumn, read first in a query that selects nothing encrypted, and then the row loaded insideLoanScope.with_library/2. The guide states that a process dictionary crosses neither a process nor a node. Two new blocks:Library.LoanViews(the read-back) andLibrary.LoanProjectionHandler(aGenServer: events by{:event, event}message, read-backs by call).Encryptor.Vault.Suspension.Store.Ets), so a deployment on more than one node configuresEncryptor.Ecto.SuspensionStoreon the vault, with the vault's:suspension_poll_intervalbounding when every other node sees a suspension. It points at the store's moduledoc and does not edit it.test/support/test_scope_in_jobs.excarries the two new blocks under the file's stated substitutions, andtest/encryptor/ecto/scope_in_jobs_guide_test.exscounts them in the block-equality test and adds a Step 5 test: the handler is started as a process of its own, handed events of two libraries from the test process with no scope and under the other library's scope, and reads each row back by its id alone, with the caller under the other library's scope and with none.Docs and test only: no change under
lib/, no new public function, module or option, and no changelog fragment (the repo'schangelog.d/README.mdexcludes documentation and test fixtures).The read-back shape (the row's own scope column first, then the load under it, in a handler process of its own; no new
ScopeContextAPI) was ruled by the operator, 2026-09-29.Gate
Full
mix qualityon the committed tree, quoted whole from the stage summary:The database arm ran (Postgres local, no skip). The commit is a bare
git commitof the staged tree, byte-identical (git write-tree) to the tree that run was green on, with the repo's gate lock and a machine slot held across both.Sabotage
Each check mutated the bead's own lines and was restored byte-equal before the next:
LoanViews.fetch!/1loading under one fixed library instead of the row's: the Step 5 test went red, the handler's read-back of the other library's row raisingDecryptError(an exit through the call rather than an assertion failure).handle_info/2dropping theproject/1call: the Step 5 test went red on its listing match.Review (in-turn)
I re-read the diff against the bead's description, acceptance and notes, and checked each claim in the new guide text by anchor. The per-node default and its loss at a vault restart are the moduledoc of
Encryptor.Vault.Suspension.Store.Etsand the:suspension_storedefault inEncryptor.Vault.Config(encryptor 0.5.0, the locked version). A suspension holding on the writing node at once and on every other node within one:suspension_poll_intervalisEncryptor.Vault.suspend/2's doc; the poll after eachlist/1is theEncryptor.Vault.Suspension.Storemoduledoc. The config snippet's shape, the generator task name and the option table areEncryptor.Ecto.SuspensionStore's moduledoc.loan_views.library_idis a plaintext:stringcolumn in the guide's test migration, so the read-back needs no new migration. The premise that the guide test counts blocks held at the tip, and the count moved with the two new blocks. The multi-node section is not run by the suite, and the guide's closing section says so.Provenance
{:event, event}message) is the guide's own illustration: the guide names no event store.