Skip to content

Commit fbc4124

Browse files
polytypiclyrm
andcommitted
Add a note about the use cases of Trigger.from_action
Co-authored-by: Carine Morel <[email protected]>
1 parent 6b6d22a commit fbc4124

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/picos/picos.mli

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,10 @@ module Trigger : sig
278278
279279
⚠️ Do not call [signal] from an effect handler in a scheduler. *)
280280

281-
(** {2 Interface for schedulers} *)
281+
(** {2 Interface for schedulers}
282+
283+
⚠️ The operations in this section are for more advanced use cases and their
284+
use requires a deeper understanding of how schedulers work. *)
282285

283286
val is_initial : t -> bool
284287
(** [is_initial trigger] determines whether the trigger is in the initial
@@ -327,6 +330,10 @@ module Trigger : sig
327330
(** [from_action x y resume] is equivalent to
328331
{{!on_signal} [let t = create () in assert (on_signal t x y resume); t]}.
329332
333+
ℹ️ This can useful when you just want to have an arbitrary callback
334+
executed when a trigger you attach to a {{!Computation} computation} is
335+
signaled.
336+
330337
⚠️ The action that you attach to a trigger must be safe to call from any
331338
context that might end up signaling the trigger directly or indirectly
332339
through {{!Computation.canceler} propagation}. Unless you know, then you

0 commit comments

Comments
 (0)