Nice trick! I am inclined to propose to use something apply like here instead. Which means avoiding dynamic memory allocation of the returned future.