0

Is there any built-in way to throttle Mechanize gem?

I'm searching something like a callback on making an HTTP request.

Later edit: I would like to implement bandwith throttling, to avoid flooding parsed sites. EG: Only allow one request per second.

Vlad Zloteanu
  • 8,464
  • 3
  • 41
  • 58

1 Answers1

1

It may be that pre_connect_hooks is what you are looking for. Sadly, I am unable to find any way to add one but adding directly a lambda/Proc to the array.

They are called here and this method is called here

Serabe
  • 3,834
  • 19
  • 24