cloudyr / MTurkR

R Client for the MTurk Requester API
https://cloud.r-project.org/package=MTurkR
91 stars 18 forks source link

throttle ContactWorker #110

Closed az0 closed 8 years ago

az0 commented 8 years ago

I have a large list of workers to contact, and if I contact them all at once, it may crash the private web server on which my survey software runs, so I propose that ContactWorkers has an additional option to sleep between contacting workers. This is a common feature in some email software, such as Silverpop, and it is called throttling.

I would call it delayor sleep.seconds

By default delay = 0.

delay > 0 is invalid in batch mode.

It would be extra nice if the resulting data frame included a time stamp for each row.

leeper commented 8 years ago

I'm not sure about this. I see the value, but at the same time it would be pretty easy to write a wrapper around ContactWorkers() to achieve this:

for (i in seq_along(w)) {
  ContactWorkers(w[i], ...)
  Sys.sleep(1)
}
az0 commented 8 years ago

Yes, for now I used a wrapper. It's up to you.