This module does everything you'd expect from a class implementing an iterator, apart from one thing: it buffers one element of the stream of scalars, produced by your code. The buffering is done by pre-fetching one element as soon as your iterator has been initialized. Every subsequent fetch will return the buffered element and add a fresh element to the internal buffer.
This behavior leads to unexpected results, and if you are using non-pure functions for you iterators (such as database operations or accessing shared variables), your code may deadlock or behave as if everything happens out of order.
If you do use pure functions for your iterators, you may find that this module is exactly what you need.