Module Private.Action

Action module with private functionality (unstable).

These definitions are subject to change even between minor versions of the library.

type nonrec 'a t = 'a t
type 'a primitive
val never : 'a t
val always : 'a -> 'a t
val choose : 'a t list -> 'a t
val map : ('a -> 'b) -> 'a t -> 'b t
val guard : (unit -> 'a t) -> 'a t
val either : 'a t -> 'b t -> ('a, 'b) Stdlib.Either.t t
val invoke : 'a t -> 'a
val invoke_poll : 'a t -> 'a option

See Affect.Action.invoke_poll.

  • deprecated May be removed in the future.
type nonrec unblocker = unblocker

Private

module Result : sig ... end

Action results.

module Meta : sig ... end

Action and action invocation metadata.

module Invocation : sig ... end

Action invocations.

module Blocked : sig ... end

Blocked action invocations.

module Primitive : sig ... end

Primitive actions.

module Unblocker : sig ... end

Action invocation unblockers.

Effects

Note. You should never handle these effects in the scope of a function given to Affect.Fun.Async.main. These effects are exposed to allow actions to be used by other schedulers. See an example here.

type Stdlib.Effect.t +=
  1. | Invoke : 'a t -> 'a Stdlib.Effect.t
    (*

    Performed on Action.invoke.

    *)
  2. | Invoke_poll : 'a t -> 'a option Stdlib.Effect.t
    (*

    Performed on Action.invoke_poll.

    *)

Effects for handling action invocations.

val do_invoke_poll : ?unblock:'a Primitive.t -> 'a t -> ('a option, unit) Stdlib.Effect.Deep.continuation -> unit

do_invoke_poll action k does everything you need to do to handle the Invoke_poll effect with a continuation k. It can implemented using Invocation.make and Invocation.do_poll but it's always the same code, so here you have. For the argument unblock see Invocation.make.