Wrapped the producer function and fed it into anonymous task function.