Add setup operator #26192
This commit is contained in:
parent
7b20b89ce0
commit
18d970fc8e
14 changed files with 574 additions and 4 deletions
|
|
@ -295,6 +295,14 @@ object Source {
|
|||
new Source(LinearTraversalBuilder.fromBuilder(other.traversalBuilder, other.shape, Keep.right), other.shape)
|
||||
}
|
||||
|
||||
/**
|
||||
* Defers the creation of a [[Source]] until materialization. The `factory` function
|
||||
* exposes [[ActorMaterializer]] which is going to be used during materialization and
|
||||
* [[Attributes]] of the [[Source]] returned by this method.
|
||||
*/
|
||||
def setup[T, M](factory: (ActorMaterializer, Attributes) ⇒ Source[T, M]): Source[T, Future[M]] =
|
||||
Source.fromGraph(new SetupSourceStage(factory))
|
||||
|
||||
/**
|
||||
* Helper to create [[Source]] from `Iterable`.
|
||||
* Example usage: `Source(Seq(1,2,3))`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue