diff options
| author | Marcos Magueta <maguetamarcos@gmail.com> | 2026-10-08 00:59:05 -0300 |
|---|---|---|
| committer | Marcos Magueta <maguetamarcos@gmail.com> | 2026-10-08 00:59:05 -0300 |
| commit | f49890e12d7eb6a766b966438cd475f7cbf5081b (patch) | |
| tree | dc0b3e09181f9aa091a10ef7eaed86670c570d70 /lib/kernel/BranchManager.ml | |
| parent | 8f5a9291647d53dd3a912853f5c230cdcb13cb74 (diff) | |
| download | RNT-f49890e12d7eb6a766b966438cd475f7cbf5081b.tar.gz RNT-f49890e12d7eb6a766b966438cd475f7cbf5081b.zip | |
rework evaluators and add schema scope
Diffstat (limited to '')
| -rw-r--r-- | lib/kernel/BranchManager.ml | 10 | ||||
| -rw-r--r-- | lib/kernel/BranchManager.mli | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/kernel/BranchManager.ml b/lib/kernel/BranchManager.ml index 052e38a..a371a0c 100644 --- a/lib/kernel/BranchManager.ml +++ b/lib/kernel/BranchManager.ml @@ -28,7 +28,7 @@ module Make (S : Abstract.Storage.STORAGE) = struct let data = Concepts.Hash.blob_of_hash addr in S.put tx (S.Label label) data - class manager ?evaluators storage label head = + class manager ?root storage label head = object (self) inherit Lifecycle.null inherit Identity.of_id @@ -51,7 +51,7 @@ module Make (S : Abstract.Storage.STORAGE) = struct let* head = Atomic.get head |> M.lookup tx key in match head with | None -> Ok None - | Some head -> B.load ?evaluators tx storage head |> Result.map Option.some ) + | Some head -> B.load ?root tx storage head |> Result.map Option.some ) method update key reference value = let open Utilities.Result in @@ -92,14 +92,14 @@ module Make (S : Abstract.Storage.STORAGE) = struct | Error (Some e) -> Error e ) end - let make ?evaluators storage label = + let make ?root storage label = let open Utilities.Result in SI.with_transaction storage (fun tx -> let* addr = root_for tx label in match addr with - | None -> Ok (new manager ?evaluators storage label M.empty |> Protocols.Handle.make) + | None -> Ok (new manager ?root storage label M.empty |> Protocols.Handle.make) | Some addr -> let* head = M.find tx addr in let* head = Option.to_result ~none:(Error.invalid_root addr) head in - Ok (new manager ?evaluators storage label head |> Protocols.Handle.make) ) + Ok (new manager ?root storage label head |> Protocols.Handle.make) ) end diff --git a/lib/kernel/BranchManager.mli b/lib/kernel/BranchManager.mli index 9fa10ca..873aa36 100644 --- a/lib/kernel/BranchManager.mli +++ b/lib/kernel/BranchManager.mli @@ -1,8 +1,8 @@ (** The heads of the branches, persisted under [label]. Branches it hands - out run their stored programs through [evaluators]. *) + out run their stored programs by the evaluators under [root]. *) module Make (S : Abstract.Storage.STORAGE) : sig val make : - ?evaluators:Protocols.Handle.t -> + ?root:Protocols.Handle.t -> S.connection -> string -> (Protocols.Handle.t, Concepts.Condition.condition) result |
