-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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 akka.japi.Either to Akka Java API helpers #25181
Comments
@laszlovandenhoek I think it would be better if you contribute a proper Java API to akka-stream-contrib. We don't have good experience with exposing Scala classes in Java APIs. E.g. Scala's Duration, Future, Option. They may seem harmless from a Scala developers perspective but just the fact that they have scala in the package name seems to scare Java developers. Therefore we try to not use such classes in Java APIs. |
There is a vavr out there:) |
I'll close this and continue here: akka/akka-stream-contrib#135 |
thanks |
As far as I can tell,
scala.util.Either
is not used anywhere in the public Java API of core Akka (or Akka Streams). However, it is used in akka-stream-contrib, particularlyPartitionWith
. Constructing ascala.util.Either
from Java code is inconvenient; for example,Either.cond
takes two by-name arguments but these are eagerly evaluated when called from Java, which often defeats the purpose of usingEither
at all.I came up with this bit to scratch that particular itch:
...but I guess this is a bit light to include as a central library component as it stands. I think it could be a valuable addition, opening up new possibilities, but before fleshing it out and submitting a PR, I figured I'd open this issue as an RFC. In particular, I'm curious if the Akka team is open to adding an
Either
to theakka.japi
package (in akka-actor), and if so, what features it should have and/or lack.The text was updated successfully, but these errors were encountered: