Create a public CalculationListener returning a future #1454

Merged
merged 1 commit into from Dec 21, 2016

Conversation

Projects
None yet
2 participants
@cjkent
Member

cjkent commented Dec 21, 2016

This PR renames AggregatingListener and moves it to the top level so it can be used by external code.

Having a CalculationListener returning a CompletableFuture is essential for writing fully asynchronous code with Strata. It seems a shame that users will have to implement it themselves when we already have one in Strata.

@jodastephen

This comment has been minimized.

Show comment
Hide comment
@jodastephen

jodastephen Dec 21, 2016

Member

Approved, as there is nothing wrong with this. However, the new public class does seem a little isolated. Another problem is that the user has is they need to pass in the columns to the ResultsListener (and typically other Strata classes have factory methods). Not sure there is a way to setup the columns automatically, but it would be nice. Maybe a calculationStarted(columns) method on CalculationListener ?

Member

jodastephen commented Dec 21, 2016

Approved, as there is nothing wrong with this. However, the new public class does seem a little isolated. Another problem is that the user has is they need to pass in the columns to the ResultsListener (and typically other Strata classes have factory methods). Not sure there is a way to setup the columns automatically, but it would be nice. Maybe a calculationStarted(columns) method on CalculationListener ?

@cjkent

This comment has been minimized.

Show comment
Hide comment
@cjkent

cjkent Dec 21, 2016

Member

I agree that it's not particularly elegant to pass the columns to the listener and the calculation runner. I like your suggestion. I'll merge this PR and raise a follow up to add calculationStarted()

Member

cjkent commented Dec 21, 2016

I agree that it's not particularly elegant to pass the columns to the listener and the calculation runner. I like your suggestion. I'll merge this PR and raise a follow up to add calculationStarted()

@cjkent cjkent merged commit 6e8aabd into master Dec 21, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@cjkent cjkent deleted the topic/results-listener branch Dec 21, 2016

@cjkent cjkent removed the Status:InReview label Dec 21, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment