sig
  type 'a scheduler
  val create : ?compare:('-> '-> int) -> unit -> 'Duppy.scheduler
  val queue :
    ?log:(string -> unit) ->
    ?priorities:('-> bool) -> 'Duppy.scheduler -> string -> unit
  val stop : 'Duppy.scheduler -> unit
  module Task :
    sig
      type ('a, 'b) task = {
        priority : 'a;
        events : 'b list;
        handler : 'b list -> ('a, 'b) Duppy.Task.task list;
      }
      type event =
          [ `Delay of float
          | `Exception of Unix.file_descr
          | `Read of Unix.file_descr
          | `Write of Unix.file_descr ]
      val add :
        'Duppy.scheduler ->
        ('a, [< Duppy.Task.event ]) Duppy.Task.task -> unit
    end
  module Async :
    sig
      type t
      exception Stoped
      val add :
        priority:'-> 'Duppy.scheduler -> (unit -> unit) -> Duppy.Async.t
      val wake_up : Duppy.Async.t -> unit
      val stop : Duppy.Async.t -> unit
    end
  module Io :
    sig
      type marker = Length of int | Split of string
      type failure = Int of int | Unix of Unix.error * string * string
      val read :
        ?recursive:bool ->
        ?init:string ->
        ?on_error:(Duppy.Io.failure -> unit) ->
        priority:'->
        'Duppy.scheduler ->
        Unix.file_descr -> Duppy.Io.marker -> (string list -> unit) -> unit
      val write :
        ?exec:(unit -> unit) ->
        ?on_error:(Duppy.Io.failure -> unit) ->
        priority:'->
        'Duppy.scheduler -> Unix.file_descr -> string -> unit
    end
end