#perl - Sun 11 Mar 2007 between 15:24 and 15:30



merlynchildren look at first table for status = todo
they set status = in progress
EricLmerlyn: But how do I then prevent the children from downloading the same link multiple times.
merlynand then grab data from second table of what specifically to do with that URL
YOU HAVE SET THE STATUS TO IN PROGRESS
only one kid can set it from todo to in progress
that's your gating
id - url - status = table 1
EricLBut then that kid has to have a knowledge of the entire table returned, no?
merlynNo
he picks SELECT url FROM table1 WHERE status = "todo" LIMIT 1
inside a transaction
then UPDATE table1 SET status = "in progress" WHERE url = THAT URL
then commit
if the comit fails, someone else got it
EricLOh, you're saying create a temporary table.
merlynNO A REAL TABLE
fuck
a status table
of how the parent tells the kids what to do
this is standard database stuff
actionmerlyn sighs
merlynsighs
EricLI understand that database stuff.
merlynparent sets up big table of "url" "todo"
kids all eat from that table
each kid is responsible for getting the next thing that is "todo"
and updating the status to "in progress"
EricLOh, I got it now.
merlynwhen done, update status to "done"
finally! :)
I do believe my link-checker-with-class-dbi does this
EricLHmmm, I didn't find that article.
merlyn... http://www.stonehenge.com/merlyn/LinuxMag/col52.html
see kids_do
actually, read the whole thing
dazjorzLeoNerd: Ok, done.
merlynthe only difference between that and yorus is that my column has kids also inserting additional tasks
dazjorzLeoNerd: I made a runscript that does exactly what I want.
merlynyours won't have that
dazjorzLeoNerd: I'll paste it so you know what I need too.

Page: 4 11 18 25 32 39 46 53 60 67 74 81 88 

IrcArchive