On Thu, 2007-05-17 at 15:56 +0900, Daisuke Maki wrote: > Hi, Hiya, > In a past experiment, I've hacked on PoCo::Client::HTTP::Request so that > it writes the data content to disk -- this greatly reduced the overhead > on each process that was doing the crawling, since hundreds or thousands > of requests may be sent all at once. But at that time it required > actually hacking on the installed PoCo::Client::HTTP::Request source, or > to cut n' paste a bunch of code from said module and doing the fack -- > which wasn't such a great idea, because the internal dependencies were > delicate enough that upgrading PoCo::Client::HTTP caused the module to > break.
Maybe you could share this? it sounds interesting. Maybe it could be incorporated? > I'd like to do something similar in Gungho, but this time I'd like to > make it so that things don't break just because we upgraded > PoCo::Client::HTTP. The easiest solution seems to be just to create a > new type of PoCo::Client::HTTP::Request, so that while the bulk of the > code may be identical to PoCo::Client::HTTP::Request, it can lead a > different life cycle that doesn't depend on the other. Can't you subclass ::Request? And if not, tell us why, because I think it is a bug if you can't easily do that. > To make this possible, I'd like to make PoCo::Client::HTTP able to > change the type of RequestFactory it creates -- or, make RequestFactory > be able to produce difference types of Requests. The latter sounds like the nicer approach. But if you want quick results, you can already give Client::HTTP a RequestFactory object to use, so you could subclass that too to make it create your subclassed P::C::C::HTTP::Request objects. Martijn