public class MergeHub<T> extends GraphStageWithMaterializedValue<SourceShape<T>,Sink<T,NotUsed>>
Modifier and Type | Class and Description |
---|---|
class |
MergeHub.InputState |
class |
MergeHub.MergedSourceLogic |
static class |
MergeHub.ProducerFailed |
Constructor and Description |
---|
MergeHub(int perProducerBufferSize) |
Modifier and Type | Method and Description |
---|---|
static Graph<S,M> |
addAttributes(Attributes attr) |
static Graph<S,M> |
async() |
scala.Tuple2<GraphStageLogic,Sink<T,NotUsed>> |
createLogicAndMaterializedValue(Attributes inheritedAttributes) |
protected static Attributes |
initialAttributes() |
static StreamLayout.Module |
module() |
static Graph<S,M> |
named(java.lang.String name) |
Outlet<T> |
out() |
SourceShape<T> |
shape()
The shape of a graph is all that is externally visible: its inlets and outlets.
|
static <T> Source<T,Sink<T,NotUsed>> |
source()
Creates a
Source that emits elements merged from a dynamic set of producers. |
static <T> Source<T,Sink<T,NotUsed>> |
source(int perProducerBufferSize)
Creates a
Source that emits elements merged from a dynamic set of producers. |
static Graph<S,M> |
withAttributes(Attributes attr) |
initialAttributes, module, withAttributes
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addAttributes, async, named
public static <T> Source<T,Sink<T,NotUsed>> source(int perProducerBufferSize)
Source
that emits elements merged from a dynamic set of producers. After the Source
returned
by this method is materialized, it returns a Sink
as a materialized value. This Sink
can be materialized
arbitrary many times and each of the materializations will feed the elements into the original Source
.
Every new materialization of the Source
results in a new, independent hub, which materializes to its own
Sink
for feeding that materialization.
If one of the inputs fails the Sink
, the Source
is failed in turn (possibly jumping over already buffered
elements). Completed Sink
s are simply removed. Once the Source
is cancelled, the Hub is considered closed
and any new producers using the Sink
will be cancelled.
perProducerBufferSize
- Buffer space used per producer. Default value is 16.public static <T> Source<T,Sink<T,NotUsed>> source()
Source
that emits elements merged from a dynamic set of producers. After the Source
returned
by this method is materialized, it returns a Sink
as a materialized value. This Sink
can be materialized
arbitrary many times and each of the materializations will feed the elements into the original Source
.
Every new materialization of the Source
results in a new, independent hub, which materializes to its own
Sink
for feeding that materialization.
If one of the inputs fails the Sink
, the Source
is failed in turn (possibly jumping over already buffered
elements). Completed Sink
s are simply removed. Once the Source
is cancelled, the Hub is considered closed
and any new producers using the Sink
will be cancelled.
public static Graph<S,M> named(java.lang.String name)
public static Graph<S,M> async()
public static Graph<S,M> addAttributes(Attributes attr)
protected static Attributes initialAttributes()
public static final StreamLayout.Module module()
public static final Graph<S,M> withAttributes(Attributes attr)
public SourceShape<T> shape()
Graph
public scala.Tuple2<GraphStageLogic,Sink<T,NotUsed>> createLogicAndMaterializedValue(Attributes inheritedAttributes)
createLogicAndMaterializedValue
in class GraphStageWithMaterializedValue<SourceShape<T>,Sink<T,NotUsed>>