Re: lwp-0.04: a patch, buglet and a question

Achim Bohnet (ach@rosat.mpe-garching.mpg.de)
Thu, 07 Sep 1995 20:44:19 +0200


>>>Gisle Aas said:
 [...]
 > 
 > There are two possibilities:
 > 
 >    1)  We pass the $ua object with the request and the protocol modules
 >        will call $ua->message("This is what I do") as things happen.  The
 >        default message() method will do nothing.  You will have to make a
 >        subclass that overrides message()
 > 
 >    2)  The protocol modules call a global procedure with these messages as
 >        argument.  This is what we do with LWP::Debug messages.
 >        You could redefine LWP::Debug::debug if you wich this behavoir today.
 > 
 > The main benefit of 1) is that you could have multiple user agents if you wi
     sh 
 > and is the OO way to do it.  2) is simpler to implement.  Any preferences?

I prefer multiple user agents. Would (in the future) allow tkweb to download
a file while one could still browse. And/or like netscape fetching images and
text in parallel.

But subclassing? Wouldn't a $ua->callback(-message => [\&logto $wid ...])
mechanism be easier to handle for the library user?

Another poin, I would suggest to change $ua->request($request, \&callback)
to [\&callback arg1 ...] like in Tk. This way one could pass widget refs. or
file handle to the routine. The behaviour/returncode should stay the same.
For parallel transfer I would suggest a $ua->requestAsync function.

 > 
 > > IMHO it would also be a nice feature for mirror/request
 > > to have a -verbose switch which informs one about the progress on STDERR.
 > 
 > We already have the -x option to request :-)

Yeah, rename it to -verbose++ :-)

 > 
 > 
 > --Gisle
 > 
Achim