jon.recoil.org

Module Brr_webworkers.Worker

Web workers.

See the Web Workers API.

Enumerations

module Type : sig ... end

The worker type enum.

Workers

type opts

The type for worker options.

opts ~type' ~credentials ~name () are worker options with given parameters. See here for defaults and semantics.

type t

The type for Worker objects.

create ~opts uri creates a worker that executes the script uri. This may throw a Jv.Error exception.

as_target w is w as an event target.

val terminate : Brr_webworkers.Worker.t -> unit

terminate w terminates worker w.

val post : ?opts:Brr_io.Message.opts -> Brr_webworkers.Worker.t -> 'a -> unit

post ~opts w v posts value v on port p with options opts (the target_origin option is meaningless in this case).

Shared workers

module Shared : sig ... end

Shared workers.

Worker context

These APIs are used by the workers.

val ami : unit -> bool

ami () is true if we are executing in a worker context.

module G : sig ... end

Worker global functions