“Forking” with POE
I’ve found a good way to allay my previous fear of forking. Using the POE library. The website says POE stands for “Perl Object Environment” but that doesn’t really explain much about it. It’s an easy way to timeslice the execution of your program. It’s threading in only one thread. The explanation of the library can get pretty complex so I’ll leave it to the people who wrote the documentation site. There’s a comprehensive cookbook that has examples of many things that are likely similar to some process you’re trying to write.
How does this all relate to SEM? It allows me to run multiple HTTP requests to the same engine at the same time. This works incredibly well for my saveAll and getAll functions in my Net objects. Now I can just spray a bunch of keywords at these functions, they’ll split the keywords into their appropriate ad groups and then update them in parallel instead of in series. What used to take me 12 hours, now only takes me 2.
Leave a Reply