Open yuri-sergiichuk opened 4 years ago
Triplet<EventMessage,EventMessage,Nothing>
This does not make much sense. It's a Pair
. But your request does make sense. How often do you need such a thing?
Depending on the answer, we'd schedule this.
Yep, the Triplet<EventMessage,EventMessage,Nothing>
is ugly. We've got 3 places in the BKO where we use ImmutableList
as a return type with just returning an empty list when smth is optional. We also have a similar approach being used in the Backlog. I believe we'll similar usages in other projects as well.
Currently, from event reactor method we can return:
EventMessage
Optional<EventMessage>
Iterable<EventMessage>
EitherOf<...>
But, to express that we want to return a pair (or triplet, or ...) of events or nothing we have now the following options:
Triplet<EventMessage,EventMessage,Nothing>
Iterable<EventMessage>
where iterable is empty when no events are emittedThe best way to express this, from my standpoint, is to have an
Optional<Pair<EventMessage, EventMessage>>
that is not supported by the framework now.