sig
  type t = Raw_monitor.t
  type 'a with_optional_monitor_name =
      ?here:Core.Std.Source_code_position.t ->
      ?info:Core.Std.Info.t -> ?name:string -> 'a
  val create : (unit -> Monitor.t) Monitor.with_optional_monitor_name
  val name : Monitor.t -> Core.Std.Info.t
  val current : unit -> Monitor.t
  val errors : Monitor.t -> exn Tail.Stream.t
  val error : Monitor.t -> exn Deferred.t
  val extract_exn : exn -> exn
  val has_seen_error : Monitor.t -> bool
  val send_exn :
    Monitor.t -> ?backtrace:[ `Get | `This of string ] -> exn -> unit
  val try_with :
    (?extract_exn:bool ->
     ?run:[ `Now | `Schedule ] ->
     ?rest:[ `Ignore | `Raise ] ->
     (unit -> 'Deferred.t) -> ('a, exn) Core.Std.Result.t Deferred.t)
    Monitor.with_optional_monitor_name
  val try_with_rest_handling :
    [ `Default of [ `Ignore | `Raise ] | `Force of [ `Ignore | `Raise ] ]
    Pervasives.ref
  val try_with_ignored_exn_handling :
    [ `Eprintf | `Ignore | `Run of exn -> unit ] Pervasives.ref
  val handle_errors :
    ((unit -> 'Deferred.t) -> (exn -> unit) -> 'Deferred.t)
    Monitor.with_optional_monitor_name
  val catch_stream :
    ((unit -> unit) -> exn Tail.Stream.t) Monitor.with_optional_monitor_name
  val catch :
    ((unit -> unit) -> exn Deferred.t) Monitor.with_optional_monitor_name
  val protect :
    ((unit -> 'Deferred.t) ->
     finally:(unit -> unit Deferred.t) -> 'Deferred.t)
    Monitor.with_optional_monitor_name
  val main : Monitor.t
  val kill : Monitor.t -> unit
  val is_alive : Monitor.t -> bool
  module Exported_for_scheduler :
    sig
      type 'a with_options = ?monitor:Monitor.t -> ?priority:Priority.t -> 'a
      val within' :
        ((unit -> 'Deferred.t) -> 'Deferred.t)
        Monitor.Exported_for_scheduler.with_options
      val within :
        ((unit -> unit) -> unit) Monitor.Exported_for_scheduler.with_options
      val within_v :
        ((unit -> 'a) -> 'a option)
        Monitor.Exported_for_scheduler.with_options
      val schedule' :
        ((unit -> 'Deferred.t) -> 'Deferred.t)
        Monitor.Exported_for_scheduler.with_options
      val schedule :
        ((unit -> unit) -> unit) Monitor.Exported_for_scheduler.with_options
      val within_context :
        Execution_context.t -> (unit -> 'a) -> ('a, unit) Core.Std.Result.t
      val preserve_execution_context :
        ('-> unit) -> ('-> unit) Core.Std.Staged.t
      val preserve_execution_context' :
        ('-> 'Deferred.t) -> ('-> 'Deferred.t) Core.Std.Staged.t
    end
  val sexp_of_t : Monitor.t -> Sexplib.Sexp.t
end