![]() ![]() Downloading is not very processor intensive. You can tweak this process even further by having separate threads for downloading and processing, so that you can have a number of threads constantly downloading content. Too much is overkill, but too little is a waste of processor time. Your computer will allow quite a number of connections, so if those 100 sites have different hostnames, it is not a problem to run 10 or 20 at the same time. You can then decide how many of those threads you want to fire at the same time. I would create a thread that can read a single url and process its content. Or is it maybe easier to start two IdHttp instances in the main thread one for first half of sites and other for second? , so they would add parsed content to form1.listbox2 in the same time. , and the other thread should do: for i := div 2 to - 1 do So basically when a user clicks parse, the main thread should do: for i := 0 to div 2 do I started reading about threads which lead to my question: Can I create a IdHttp instance in a thread with parsing function and tell it to parse half of the sites in the listbox? It is something like a Google music search program it uses Google queries to make Google search easier. The problem is that I have a listbox filled with more than 100 sites, my program downloads source to a memo and parses that source for mp3 files. What is the fastest way to download webpage source into a memo component? I use Indy and HttpCli components.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |