Docs: API docs for asSourceWithContext (#28950)
This commit is contained in:
parent
2db52a06ea
commit
c2945a3e7f
2 changed files with 6 additions and 0 deletions
|
|
@ -4312,6 +4312,9 @@ final class Source[Out, Mat](delegate: scaladsl.Source[Out, Mat]) extends Graph[
|
||||||
def logWithMarker(name: String, marker: function.Function[Out, LogMarker]): javadsl.Source[Out, Mat] =
|
def logWithMarker(name: String, marker: function.Function[Out, LogMarker]): javadsl.Source[Out, Mat] =
|
||||||
this.logWithMarker(name, marker, ConstantFun.javaIdentityFunction[Out], null)
|
this.logWithMarker(name, marker, ConstantFun.javaIdentityFunction[Out], null)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Transform this source whose element is ``e`` into a source producing tuple ``(e, f(e))``
|
||||||
|
**/
|
||||||
def asSourceWithContext[Ctx](extractContext: function.Function[Out, Ctx]): SourceWithContext[Out, Ctx, Mat] =
|
def asSourceWithContext[Ctx](extractContext: function.Function[Out, Ctx]): SourceWithContext[Out, Ctx, Mat] =
|
||||||
new scaladsl.SourceWithContext(this.asScala.map(x => (x, extractContext.apply(x)))).asJava
|
new scaladsl.SourceWithContext(this.asScala.map(x => (x, extractContext.apply(x)))).asJava
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -246,6 +246,9 @@ final class Source[+Out, +Mat](
|
||||||
combineRest(2, rest.iterator)
|
combineRest(2, rest.iterator)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Transform this source whose element is ``e`` into a source producing tuple ``(e, f(e))``
|
||||||
|
**/
|
||||||
def asSourceWithContext[Ctx](f: Out => Ctx): SourceWithContext[Out, Ctx, Mat] =
|
def asSourceWithContext[Ctx](f: Out => Ctx): SourceWithContext[Out, Ctx, Mat] =
|
||||||
new SourceWithContext(this.map(e => (e, f(e))))
|
new SourceWithContext(this.map(e => (e, f(e))))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue