amendByRevision
suspend fun amendByRevision(amendment: ParkedAmendment, read: suspend () -> ParkedAggregate?, replace: suspend (amended: ParkedAggregate, revision: Long) -> Boolean): ParkedAggregate?
FailureLedger.amend's generic path, for an amendment a ledger has no statement of its own for: reads the entry (read), applies amendment to it (amended) and stores the result (replace) only while the stored entry is still at the revision read. A write that finds another revision lost to a writer that changed the entry since the read: the entry is read again and the amendment applied to what that writer left, so no write is lost, and the loop ends, each turn it takes being another writer's progress.
replace stores the amended entry while the stored one is at the revision it is given, and says whether it did.
Return
the amended entry; null when the aggregate is not parked, or the amendment names a revision read that the entry is no longer at.