[Yum-devel] URLGrabber Batch Mode
Michael Stenner
mstenner at linux.duke.edu
Sun Feb 29 02:13:41 UTC 2004
On Sat, Feb 28, 2004 at 02:20:20PM -0500, Ryan Tomayko wrote:
> On Sat, 2004-02-28 at 08:23, David Farning wrote:
> > To be truly useful, fail over logic and leach prevention would need to
> > be handled within the batchedUrlGrabber. What a pain, how much gain?
>
> Right. That's the question. It's going to be a pain regardless, right?
> Is it something we do in URLGrabber so yum and others can take advantage
> of it or do we think each app will want to roll it's own mechanisms
> (like your thread pool suggestion) for doing this kind of thing? I'm
> 50/50 right now. Half of me thinks it could be really useful to apps
> that don't have anything for forking or establishing concurrent
> downloads; the other half thinks it won't be used at all because it will
> be implemented at the application layer anyway.
I think you're thinking about it in the right way. One approach might
be to write module that goes in urlgrabber that does this stuff. It
could be in batch.py or something, and provide such an interface.
That is, you could something like:
from URLGrabber.grabber import URLGrabber
from URLGrabber.mirror import MirrorGroup
from URLGrabber.batch import BatchGrabber
ug = URLGrabber()
mg = MirrorGroup(ug, ['http://foo.com/', 'ftp://bar.com/'])
bg = BatchGrabber(mg)
ret = bg.batchgrab(['file1', 'file2', 'somedir/file3'])
We might even consider a similar syntax for the requested file list:
each item can be a string or a dict, in which case, options can be
passed on for that file individually.
I got a bit off on a tangent there, but what I'm trying to say is that
if someone wanted to use this, they could. If they didn't want to use
it, it wouldn't get in their way. They wouldn't even have to load the
module.
I'm not necessarily saying I want to do it, or that I think it's
worthwhile. Just that if we do implement it, this approach balances
these issues fairly well.
-Michael
--
Michael D. Stenner mstenner at ece.arizona.edu
ECE Department, the University of Arizona 520-626-1619
1230 E. Speedway Blvd., Tucson, AZ 85721-0104 ECE 524G
More information about the Yum-devel
mailing list