Closed teodesian closed 7 years ago
this is looking pretty scary actually. Seems it's losing data along the way!
According to Mario, I can do more than mitigate this behavior by simply passing an arrayref to mce_loop. As such, this issue is reopened.
Hi @teodesian.
Folks have wanted the ability for MCE to process a hash as input data. That feature was added recently. But, that made knowing the type to process problematic for an array containing a single element which happens to be a hash ref. MCE will think to process a hash due to being a single element. To ensure MCE is choosing the right type, the solution is to give mce_loop the array ref ( $runs ) instead of ( @$runs ). This is the recommendation when input data contains nested data.
Regards, Mario
@marioroy it looks like accepting arrayrefs has been a feature of MCE::Loop::run() for some time now, at least as far as github knows:
This shouldn't be a problem for the deploy environments I care about, so hopefully I won't have to worry about specifying a minimum version. That is, supposing that my interpretation of the above code is correct.
@teodesian your interpretation is correct. MCE::Loop supported arrayrefs since introduction or 1.500.
single elem arrays appear to be de-arrayed. Easy enough