Up

module Downloader

: sig

Low-level download interface

#
type download_result = [
| `aborted_by_user
| `network_failure of string
| `tmpfile of Support.Common.filepath
]
#
exception Unmodified
#
type progress = (Int64.t * Int64.t option * bool) Lwt_react.signal
#
type download = {
# cancel
: unit -> unit Lwt.t;
# url
: string;
# progress
: progress;
# hint
: string option;
}
#
val is_in_progress : download -> bool
#
val interceptor : (?if_slow:unit Lazy.t -> ?size:Int64.t -> ?modification_time:float -> Pervasives.out_channel -> string -> [
| `network_failure of string
| `redirect of string
| `success
| `aborted_by_user
] Lwt.t) option Pervasives.ref
#
type monitor = download -> unit
#
type downloader = < download : 'b . switch:Lwt_switch.t -> ?modification_time:float -> ?if_slow:unit Lazy.t -> ?size:Int64.t -> ?start_offset:Int64.t -> ?hint:([< ] as 'b) -> string -> download_result Lwt.t >
#
class type download_pool =
#
method with_monitor : monitor -> downloader
#
method release : unit
#
val make_pool : max_downloads_per_site:int -> download_pool
end