-
Notifications
You must be signed in to change notification settings - Fork 254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Infinite series expansion #211
Comments
so basically you are saying it should use only the enumerable interface ? The array interface has the advantage of not needing to send all elements across the inter-process-pipe which means they don't get serialized (overhead / possibly unserializable), so I'd like to avoid that when possible. For this example a possible solution would be to create a lambda that yields A A solution could be to say "if it is not an Array but an Enumerable use the Enumerable interface". That would also solve infinite ranges like I kinda doubt it's a big issue since it never came up before and there are easy workarounds, so I'd prefer to not change the internal behavior for no good reason. If you want to experiment with it, make a PR and see how messy it gets and maybe ping a few prior contributors on their thoughts. |
I've just been using I'll have a play and see if I can come up with anything useful/clean. |
ah true, progress would break too :(
might just make it easier by adding a `enum: true` option that does the
enum->lambda conversion ... but idk if that's a lot of help
…On Mon, Oct 23, 2017 at 12:23 AM, cyclotron3k ***@***.***> wrote:
I've just been using Enumerator a bit recently, and it would be useful
(to me) if it could be lazily evaluated in the same way that Parallel
handles lambdas. It would prevent the use of progress, though, which
would be an issue.
I'll have a play and see if I can come up with anything useful/clean.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#211 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAsZ58Hx75jFlL8DjMpCsFp0lt3XGoQks5su8BrgaJpZM4P9DR7>
.
|
parallel/lib/parallel.rb
Line 92 in 4fe8381
Parallel provides
each
andmap
methods, implying it works well with Enumerables, but it fails with the following [contrived] use case:...because if the first argument to
Parallel.each
is not a lambda,.to_a
is called and it tries to expand the infinite series.The text was updated successfully, but these errors were encountered: