package brr

  1. Overview
  2. Docs
Browser programming toolkit for OCaml

Install

dune-project
 Dependency

Authors

Maintainers

Sources

brr-0.0.8.tbz
sha512=49e7bfbad2ea6a0139354e4a33c59c8a113c4c1e20a4f629bc5cad24aa801e474b4af10ce35adbda5d23dd294d1de5efa5b10bb3030d03f4758459977250a0f6

doc/brr/Brr_webworkers/Worker/index.html

Module Brr_webworkers.WorkerSource

Web workers.

See the Web Workers API.

Enumerations

Sourcemodule Type : sig ... end

The worker type enum.

Workers

Sourcetype opts

The type for worker options.

Sourceval opts : ?type':Type.t -> ?credentials:Brr_io.Fetch.Request.Credentials.t -> ?name:Jstr.t -> unit -> opts

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

Sourcetype t

The type for Worker objects.

Sourceval create : ?opts:opts -> Jstr.t -> t

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

Sourceval as_target : t -> Brr.Ev.target

as_target w is w as an event target.

Sourceval terminate : t -> unit

terminate w terminates worker w.

Sourceval post : ?opts:Brr_io.Message.opts -> 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

Sourcemodule Shared : sig ... end

Shared workers.

Worker context

These APIs are used by the workers.

Sourceval ami : unit -> bool

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

Sourcemodule G : sig ... end

Worker global functions