Module Fut_backend_base
Fut backend base module.
Implements the exception trap and defines backend tools and signatures.
Exception trap
type exn_ctx
=[
|
`Queue of string
|
`Future
|
`Finalizer
|
`Backend
|
`Fd_action
|
`Timer_action
|
`Signal_action
|
`Runtime_action
|
`Exn_trap
]
The type for exception contexts.
type exn_info
= exn_ctx * exn * Stdlib.Printexc.raw_backtrace
The type for info about trapped exceptions. The context, the exception, and the backtrace.
val set_exn_trap : (exn_info -> unit) -> unit
set_exn_trap h
is a function called whenever the runtime system catches an exception.
val pp_exn_info : Stdlib.Format.formatter -> exn_info -> unit
pp_exn_info ppf i
prints an unspecified representation ofi
onppf
.
val exn_trap : exn_ctx -> exn -> Stdlib.Printexc.raw_backtrace -> unit
exn_traps ctx exn bt
traps the exceptionexn
in contextctx
with backtracebt
.
val trap : exn_ctx -> ('a -> unit) -> 'a -> unit
trap ctx f x
executesf x
and if it raises traps the exception with contextctx
.
Backend tools
val err_invalid_worker_count : int -> string
err_invalid_worker_count n
is a string to raiseInvalid_argument
wheneverset_worker_count
is called withn < 0
.
Queues
Backend interface
type abort
= unit -> unit
See
Fut.Runtime.abort
.
module type Backend = sig ... end
Fut backend interface.