GitHub user nvollmar added a comment to the discussion: Stream JavaDSL: start 
adding alternate methods that use Java function interfaces instead of the Pekko 
ones

I've never really used the java API of Akka/Pekko. 
Would it be a long-term goal to switch all java api functions over from 
japi.function to java.util.function?
That would question would probably have a big impact on the best way to solve 
this.

Personally I don't like method suffixes like `V2` as they are not really 
descriptive.
Another option instead of another package would be a sub-object to place such 
methods. Simple Example:
```
object Flow {
  ...
  def statefulMap[S, T](
    create: function.Creator[S],
    f: function.Function2[S, Out, Pair[S, T]],
    onComplete: function.Function[S, Optional[T]]): javadsl.Flow[In, T, Mat] = 
...

  object juf {
      def statefulMap[R, T](
        create: java.util.function.Supplier[R],
        f: java.util.function.BiFunction[R, Out, T],
        close: java.util.function.Function[R, Optional[T]]): javadsl.Flow[In, 
T, Mat] = ...
   }
}
```

So `Flow.statefulMap()` vs `Flow.juf.statefulMap()`

GitHub link: 
https://github.com/apache/incubator-pekko/discussions/960#discussioncomment-8133905

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to