support lambdas in threads

@amw does this look good ?
I'll try processes next ...


This is very confusing and potentially dangerous. You are ignoring the value of requested index and simply returning the next value. A surprising class behavior is always bad design even if you're now using the class in a way that does not cause problems.