darcs-2.11.0: a distributed, interactive, smart revision control system

Safe HaskellSafe-Inferred

Darcs.Util.Download.Request

Synopsis

Documentation

data UrlRequest

A UrlRequest object contains a url to get, the file into which the contents at the given url should be written, the cachability of this request and the request's priority.

Constructors

UrlRequest 

data Cachable

Constructors

Cachable 
Uncachable 
MaxAge !CInt 

Instances

data UrlState

A UrlState object contains a map of url -> InProgressStatus, a Q of urls waiting to be started, the current pipe length and the unique junk to create unique filenames.

Constructors

UrlState 

Fields

inProgress :: Map String InProgressStatus
 
waitToStart :: Q String
 
pipeLength :: Int
 
randomJunk :: String
 

data Q a

Q represents a prioritised queue, with two-tier priority. The left list contains higher priority items than the right list.

Constructors

Q [a] [a] 

readQ :: Q a -> Maybe (a, Q a)

readQ will try and take an element from the Q, preferring elements from the high priority list.

insertQ :: a -> Q a -> Q a

insertQ inserts a low priority item into a Q.

pushQ :: a -> Q a -> Q a

pushQ inserts a high priority item into a Q.

addUsingPriority :: Priority -> a -> Q a -> Q a

Return a function for adding an element based on the priority.

deleteQ :: Eq a => a -> Q a -> Q a

deleteQ removes any instances of a given element from the Q.

elemQ :: Eq a => a -> Q a -> Bool

deleteQ checks for membership in a Q.

emptyQ :: Q a

emptyQ is an empty Q.

nullQ :: Q a -> Bool

nullQ checks if the Q contains no items.

data Priority

Constructors

High 
Low 

Instances

data ConnectionError

Data type to represent a connection error. The following are the codes from libcurl which map to each of the constructors: * 6 -> CouldNotResolveHost : The remote host was not resolved. * 7 -> CouldNotConnectToServer : Failed to connect() to host or proxy. * 28 -> OperationTimeout: the specified time-out period was reached.