igrigorik/em-synchrony — pull request #111 by fl00r (2012-02-20 15:05:29+00:00)
Title: Fiber Iterator with timer

I am not sure if this kind of stuff should be in em-synchrony, but...

I was working on sending async http_requests. As far as http_requests could be slow and after party could be even slower (parsing json, saving to database etc) I use FiberIterator for concurrency. But sending 50 request at a time looks not a best solution for me. So I thought about 50 concurrent processes, but each should be sended once per `timeout`.

So I use this FiberPeriodicTimerIterator to work with 50 concurrent requests. Each request is sended once per 0.2 sec. So in some cases I have got 50 parallel parsers without bruteforcing api server.

```ruby
FiberPeriodicTimerIterator.new(some_enumerable, 50, 0.2)
```

If this is ok. Next question is about design. It can extend the basic capabilities of FiberIterator, or it can be separate class.