sig
type 'a scheduler
val create : ?compare:('a -> 'a -> int) -> unit -> 'a Duppy.scheduler
val queue :
?log:(string -> unit) ->
?priorities:('a -> bool) -> 'a Duppy.scheduler -> string -> unit
val stop : 'a 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 :
'a Duppy.scheduler ->
('a, [< Duppy.Task.event ]) Duppy.Task.task -> unit
end
module Async :
sig
type t
exception Stopped
val add :
priority:'a -> 'a Duppy.scheduler -> (unit -> float) -> 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
| Unknown of exn
val read :
?recursive:bool ->
?init:string ->
?on_error:(Duppy.Io.failure -> unit) ->
priority:'a ->
'a Duppy.scheduler ->
Unix.file_descr -> Duppy.Io.marker -> (string list -> unit) -> unit
val write :
?exec:(unit -> unit) ->
?on_error:(Duppy.Io.failure -> unit) ->
priority:'a ->
'a Duppy.scheduler -> Unix.file_descr -> string -> unit
end
end