[darcs-devel] http pipelining

David Roundy droundy at darcs.net
Mon Dec 17 23:43:53 UTC 2007

On Mon, Dec 17, 2007 at 02:05:32PM -0800, Stefan O'Rear wrote:
> On Mon, Dec 17, 2007 at 12:23:33PM -0500, David Roundy wrote:
> > In either case, the sanest pure interface that I can imagine would involve
> > *darcs* seeing itself as doing parallel downloads, while the HTTP library
> > (whichever is used) queues these parallel downloads into an HTTP pipeline.
> > Otherwise we'd be reduced to moving things into the IO monad that don't
> > belong there, which would be rather ugly indeed.  Or alternatively, we
> > could restrict pipeline to special cases (e.g. darcs get), and use the
> > existing mechanism the rest of the time.  But it'd be nicer to have a nice
> > interface that optimizes all network access.
> How about something like:
> data Cookie = C { getData :: L.ByteString }
> fetchURL :: URI -> Cookie           -- sends request when forced, reads responce when deeply forced
> {- sample implementation, ignores the existance of multiple servers and
> the Connection: close header -}

Any chance you'd care to turn your sample implementation into a real
implementation? :) Alas, I don't know the libraries you're referring to in
it well enough to do more than guess as to how it might be working.  As far
as I can see the idea is to have a single global variable sock that holds
a single socket to be used for all http communication?

I understand properly that this will work fine with a synchronous darcs (as
darcs currently is) that uses the contents of one downloaded file before
sending the request for the next? Or are you just giving an example of how
we could construct an interface for a darcs does asynchronous downloads?
David Roundy
Department of Physics
Oregon State University
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.osuosl.org/pipermail/darcs-devel/attachments/20071217/f2d86377/attachment-0001.pgp 

More information about the darcs-devel mailing list