Merge pull request #19165 from hochgi/hochgi-unfold-docs-fixes
=str fixing documentation for PR #19143
This commit is contained in:
commit
08d0f2290d
2 changed files with 15 additions and 15 deletions
|
|
@ -172,20 +172,20 @@ object Source {
|
|||
new Source(scaladsl.Source.repeat(element))
|
||||
|
||||
/**
|
||||
* create a `Source` that will unfold a value of type `S` into
|
||||
* 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, Option[(S, E)]]): Source[E, Unit] =
|
||||
new Source(scaladsl.Source.unfold(s)((s: S) ⇒ f.apply(s)))
|
||||
|
||||
/**
|
||||
* same as unfold, but uses an async function to generate the next state-element tuple.
|
||||
* 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, Future[Option[(S, E)]]]): Source[E, Unit] =
|
||||
new Source(scaladsl.Source.unfoldAsync(s)((s: S) ⇒ f.apply(s)))
|
||||
|
||||
/**
|
||||
* simpler unfold, for infinite sequences.
|
||||
* Simpler [[unfold]], for infinite sequences.
|
||||
*/
|
||||
def unfoldInf[S, E](s: S, f: function.Function[S, (S, E)]): Source[E, Unit] = {
|
||||
new Source(scaladsl.Source.unfoldInf(s)((s: S) ⇒ f.apply(s)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue