'An equivalent of itertools.imap().
The chunksize argument is the same as the one used by the
map() method. For very long iterables using a large value for
chunksize can make make the job complete much faster than
using the default value of 1.
Also if chunksize is 1 then the next() method of the iterator
returned by the imap() method has an optional timeout
parameter: next(timeout) will raise processing.TimeoutError if
the result cannot be returned within timeout seconds.'

def imap(self, func, iterable, chunksize=1):

    collector = OrderedResultCollector(as_iterator=True)
    self._create_sequences(func, iterable, chunksize, collector)
    return iter(collector)
