=str - 16503 - Implements a dedicated FutureSource
Avoids the overhead of `Source.single(future).mapAsyncUnordered(1)(identity).withAttr…` Fixes #16503
This commit is contained in:
parent
1ac9b4eafb
commit
59bff70c87
2 changed files with 24 additions and 1 deletions
|
|
@ -215,7 +215,7 @@ object Source {
|
|||
* The stream terminates with a failure if the `Future` is completed with a failure.
|
||||
*/
|
||||
def fromFuture[T](future: Future[T]): Source[T, Unit] =
|
||||
single(future).mapAsyncUnordered(1)(ConstantFun.scalaIdentityFunction).withAttributes(DefaultAttributes.futureSource)
|
||||
fromGraph(new FutureSource(future))
|
||||
|
||||
/**
|
||||
* Elements are emitted periodically with the specified interval.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue