Module Downloader.Make

Parameters

module Key : sig ... end
module Attempt : sig ... end
module Result : sig ... end
module Knowledge_context : sig ... end

Signature

type t
val to_yojson : t -> Yojson.Safe.t
module Job : sig ... end
val cancel : t -> Key.t -> unit
val create : max_batch_size:int -> stop:unit Async.Deferred.t -> trust_system:Trust_system.t -> get: ( Network_peer.Peer.t -> Key.t list -> Result.t list Async.Deferred.Or_error.t ) -> knowledge_context:Knowledge_context.t Pipe_lib.Broadcast_pipe.Reader.t -> knowledge: ( Knowledge_context.t -> Network_peer.Peer.t -> Key.t Claimed_knowledge.t Async.Deferred.t ) -> peers:( unit -> Network_peer.Peer.t list Async.Deferred.t ) -> preferred:Network_peer.Peer.t list -> t Async.Deferred.t
val download : t -> key:Key.t -> attempts:Attempt.t Network_peer.Peer.Map.t -> Job.t
val mark_preferred : t -> Network_peer.Peer.t -> now:Core.Time.t -> unit
val add_knowledge : t -> Network_peer.Peer.t -> Key.t list -> unit
val update_knowledge : t -> Network_peer.Peer.t -> Key.t Claimed_knowledge.t -> unit
val total_jobs : t -> int
val check_invariant : t -> unit
val set_check_invariant : ( t -> unit ) -> unit