[darcs-devel] darcs patch: add optional support for using the pure haskell Networ...
John Meacham
john at repetae.net
Thu Jan 10 23:28:52 UTC 2008
On Thu, Jan 10, 2008 at 06:16:55PM -0500, David Roundy wrote:
> On Thu, Jan 10, 2008 at 03:07:02PM -0800, John Meacham wrote:
> > On Thu, Jan 10, 2008 at 05:37:48PM -0500, David Roundy wrote:
> > > On Thu, Jan 10, 2008 at 02:00:05PM -0800, John Meacham wrote:
> > > > Thu Jan 10 13:58:59 PST 2008 John Meacham <john at repetae.net>
> > > > * add optional support for using the pure haskell Network.HTTP http implementation
> > >
> > > Thanks for the contribution! I notice that Network.HTTP uses strict Strings
> > > to store the file contents, which is rather troubling in terms of
> > > performance! I suppose this opens the door for a potential rewrite of
> > > Network.HTTP for darcs?
> >
> > Yes. I am actually working on adding persistant connections and
> > ByteString support to HTTP for this. I just wanted to get the quick
> > dirty and working version in there first and get some feedback.
>
> Great! That's exactly the news I wanted to hear! :)
>
> Have you taken followed the discussion we've been having about libwww and
> the internal API? I think that the combination of getUrls and waitForURL
> sounds like a good interface for pipelined downloads... although I notice
> you mention persistent connections but not pipelining. Any chance you'd be
> willing to take a shot at pipelining?
Yeah, I meant pipelining actually. well, both.
I am not sure what the exact form of the API will take at the moment. I
was thinking something like:
data RemoteConnection = ....
data Response = ...
data Token = ...
-- create a connection object
newRemoteConnection :: IO RemoteConnection
-- queue a request and what to do when you get the response.
addRequest :: RemoteConnection -> URL -> (Response -> IO ()) -> IO Token
-- wait for a specific one to finish
waitForOne :: Token -> IO ()
-- wait for all to finish
waitForAll :: RemoteConnection -> IO ()
which should be enough to provide the functionality of getUrls.
John
--
John Meacham - ⑆repetae.net⑆john⑈
More information about the darcs-devel
mailing list