File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ let make () =
1515 fut, fut
1616
1717let [@ inline] return x : _ t = C. returned x
18+ let [@ inline] cancel x ebt = C. cancel x (fst ebt) (snd ebt)
19+ let [@ inline] try_cancel x ebt = C. try_cancel x (fst ebt) (snd ebt)
1820
1921let [@ inline] fail exn bt : _ t =
2022 let fut = C. create () in
Original file line number Diff line number Diff line change @@ -51,6 +51,15 @@ val on_result_ignore : _ t -> (Exn_bt.t option -> unit) -> unit
5151
5252exception Already_fulfilled
5353
54+ val try_cancel : _ promise -> Exn_bt .t -> bool
55+ (* * [try_cancel promise ebt] tries to cancel the promise, returning [true]. It
56+ returns [false] if the promise is already resolved.
57+ @since NEXT_RELEASE *)
58+
59+ val cancel : _ promise -> Exn_bt .t -> unit
60+ (* * Silent version of {!try_cancel}, ignoring the result.
61+ @since NEXT_RELEASE *)
62+
5463val fulfill : 'a promise -> 'a or_error -> unit
5564(* * Fullfill the promise, setting the future at the same time.
5665 @raise Already_fulfilled if the promise is already fulfilled. *)
You can’t perform that action at this time.
0 commit comments