feat fib: add Private.cancel_from_outside

This commit is contained in:
Simon Cruanes 2024-06-26 11:02:14 -04:00
parent 11b4042707
commit b47da2396e
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4
2 changed files with 5 additions and 0 deletions

View file

@ -40,6 +40,10 @@ module Private_ = struct
match A.get self.state with match A.get self.state with
| Alive _ -> false | Alive _ -> false
| Terminating_or_done _ -> true | Terminating_or_done _ -> true
let cancel_from_outside (self : _ t) ebt : unit =
Fut.fulfill_idempotent (Fut.Private_.unsafe_promise_of_fut self.res)
@@ Error ebt
end end
include Private_ include Private_

View file

@ -31,6 +31,7 @@ module Private_ : sig
type any = Any : _ t -> any [@@unboxed] type any = Any : _ t -> any [@@unboxed]
val get_cur : unit -> any option val get_cur : unit -> any option
val cancel_from_outside : _ t -> Exn_bt.t -> unit
end end
(**/**) (**/**)