aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/Generator.ml
diff options
context:
space:
mode:
authorMarcos Magueta <maguetamarcos@gmail.com>2026-10-11 00:17:53 -0300
committerMarcos Magueta <maguetamarcos@gmail.com>2026-10-11 00:17:53 -0300
commit470491974d1498a1982a4e4b3560370bdf3d8c27 (patch)
treeba4208b73b3f921545df4e0101747f083d8c0602 /lib/kernel/Generator.ml
parent0161187d843c84011749139a85c0eb31685bbc4c (diff)
parent90e41279094c26e6fcc93966708374b8ceba80e4 (diff)
downloadRNT-470491974d1498a1982a4e4b3560370bdf3d8c27.tar.gz
RNT-470491974d1498a1982a4e4b3560370bdf3d8c27.zip
merge lifecycle-ergonomics and rework modes and contain checks
Diffstat (limited to 'lib/kernel/Generator.ml')
-rw-r--r--lib/kernel/Generator.ml4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/kernel/Generator.ml b/lib/kernel/Generator.ml
index 272bb86..b83de3b 100644
--- a/lib/kernel/Generator.ml
+++ b/lib/kernel/Generator.ml
@@ -12,7 +12,7 @@ let resume k = Effect.Deep.continue k ()
class producer_cursor produce finally =
object (self)
- inherit Lifecycle.null
+ inherit Lifecycle.counted
inherit Identity.of_id
method to_string = "producer-cursor"
val mutable state : [`Fresh | `Live of (unit, step) Effect.Deep.continuation | `Done] = `Fresh
@@ -49,7 +49,7 @@ class producer_cursor produce finally =
if limit <= 0 then Ok Protocols.Cursor.{tuples= BatFingerTree.empty; exhausted= state = `Done}
else fill 0 BatFingerTree.empty
- method! release = match state with `Fresh | `Live _ -> self#finish | `Done -> ()
+ method destroy = match state with `Fresh | `Live _ -> self#finish | `Done -> ()
end
let cursor_of ?finally produce = new producer_cursor produce finally |> Protocols.Handle.make