Skip to content

Commit

Permalink
Merge pull request akka#19699 from johanandren/wip-19698-scala-tuples…
Browse files Browse the repository at this point in the history
…-in-java-source-johanandren

!str akka#19698 Remove tuple from Java API Source signatures
  • Loading branch information
rkuhn committed Feb 8, 2016
2 parents cd8eba9 + 8c60ad0 commit f817130
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions akka-stream/src/main/scala/akka/stream/javadsl/Source.scala
Original file line number Diff line number Diff line change
Expand Up @@ -198,16 +198,16 @@ object Source {
* Create a `Source` that will unfold a value of type `S` into
* a pair of the next state `S` and output elements of type `E`.
*/
def unfold[S, E](s: S, f: function.Function[S, Optional[(S, E)]]): Source[E, NotUsed] =
new Source(scaladsl.Source.unfold(s)((s: S) f.apply(s).asScala))
def unfold[S, E](s: S, f: function.Function[S, Optional[Pair[S, E]]]): Source[E, NotUsed] =
new Source(scaladsl.Source.unfold(s)((s: S) f.apply(s).asScala.map(_.toScala)))

/**
* Same as [[unfold]], but uses an async function to generate the next state-element tuple.
*/
def unfoldAsync[S, E](s: S, f: function.Function[S, CompletionStage[Optional[(S, E)]]]): Source[E, NotUsed] =
def unfoldAsync[S, E](s: S, f: function.Function[S, CompletionStage[Optional[Pair[S, E]]]]): Source[E, NotUsed] =
new Source(
scaladsl.Source.unfoldAsync(s)(
(s: S) f.apply(s).toScala.map(_.asScala)(akka.dispatch.ExecutionContexts.sameThreadExecutionContext)))
(s: S) f.apply(s).toScala.map(_.asScala.map(_.toScala))(akka.dispatch.ExecutionContexts.sameThreadExecutionContext)))

/**
* Create a `Source` that immediately ends the stream with the `cause` failure to every connected `Sink`.
Expand Down

0 comments on commit f817130

Please sign in to comment.