vlingo / xoom-common

The VLINGO XOOM platform SDK common tools shared across various projects.
Other
16 stars 10 forks source link

implements Completes#interchange #28

Closed buritos closed 4 years ago

buritos commented 4 years ago

(Outcome<E, Completes<A>>) -> Completes<Outcome<E, A>>

kmruiz commented 4 years ago

Looks good to me! I would like to know the implication of doing this with RepetableCompletes. @VaughnVernon

buritos commented 4 years ago

implication of doing this with RepetableCompletes

thanks for pointing that out, @kmruiz

VaughnVernon commented 4 years ago

@kmruiz @buritos I am not certain about implications for RepeatableCompletes, but it doesn't seem to have anything to interfere there. Sort of the only thing that differs with RepeatableCompletes is that after an outcome it is made to look like it is fresh again, but without allocation (using mutation) and this does not happen until repeat() is used by the client. Assuming that the client is the one controlling the use of interchange() it would seem to occur before the repeat().

buritos commented 4 years ago

@VaughnVernon should I add a test with RepeatableCompletes?

VaughnVernon commented 4 years ago

@buritos Yes please.

buritos commented 4 years ago

@VaughnVernon @kmruiz I tried to test invert (renamed from interchange) with RepeatableCompletes. It works, although I expected that the way I structured the test should not compile! I have posted the code on Slack. I also tested some other variations, some of which worked, others didn't (timed-out) but can't explain why any of that is valid code. I can share more on Slack in case you are interested. I decided not to commit any of that since invert is thoroughly covered by the tests I already included and I believe that those issues have nothing to do with the implementation of invert. Merging this now so that @wwerner can make progress in schemata 🎉