Skip to content
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

Add monoid and semigroup for Execution #1379

Merged
merged 1 commit into from
Jul 21, 2015
Merged

Conversation

johnynek
Copy link
Collaborator

Just added for completeness. Probably only real application is:

Monoid.sum(actionList: List[Execution[Unit]]): Execution[Unit]

which can be nice to combine a bunch of independent execution jobs into one.

@Gabriella439
Copy link
Contributor

Yay! I love this!

+1

@jnievelt
Copy link
Contributor

If it'll be used to sum, should we add sumOption which uses Execution.sequence?

@johnynek
Copy link
Collaborator Author

I thought about that, but that would force us to materialize an Iterator of these into a Sequence, just to get the sumOption. It's not clear that is always a win. Instead, this is incremental and less code.

If you prefer, I can do it, but given that Execution is generally VERY slow code (it talks to the cluster in the interesting cases), I thought it was better to default to the smaller memory case.

@johnynek
Copy link
Collaborator Author

@jnievelt let me know either way.

@jnievelt
Copy link
Contributor

@johnynek sure sgtm, can always add it later

johnynek added a commit that referenced this pull request Jul 21, 2015
Add monoid and semigroup for Execution
@johnynek johnynek merged commit 8387294 into develop Jul 21, 2015
@johnynek johnynek deleted the oscar/executionmonoid branch July 21, 2015 21:02
@ianoc ianoc mentioned this pull request Aug 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants