Class MergeHub
A MergeHub is a special streaming hub that is able to collect streamed elements from a dynamic set of producers. It consists of two parts, a Source<TOut, TMat> and a Sink<TIn, TMat>. The Source<TOut, TMat> streams the element to a consumer from its merged inputs. Once the consumer has been materialized, the Source<TOut, TMat> returns a materialized value which is the corresponding Sink<TIn, TMat>. This Sink<TIn, TMat> can then be materialized arbitrary many times, where each of the new materializations will feed its consumed elements to the original Source<TOut, TMat>.
Inherited Members
Namespace: Akka.Streams.Dsl
Assembly: Akka.Streams.dll
Syntax
public static class MergeHub
Methods
| Improve this Doc View SourceSource<T>()
Creates a Source<TOut, TMat> that emits elements merged from a dynamic set of producers. After the Source<TOut, TMat> returned by this method is materialized, it returns a Sink<TIn, TMat> as a materialized value. This Sink<TIn, TMat> can be materialized arbitrary many times and each of the materializations will feed the elements into the original Source<TOut, TMat>.
Every new materialization of the Source<TOut, TMat> results in a new, independent hub, which materializes to its own Sink<TIn, TMat> for feeding that materialization.
If one of the inputs fails the Sink<TIn, TMat>, the Source<TOut, TMat> is failed in turn (possibly jumping over already buffered elements). Completed Sink<TIn, TMat>s are simply removed. Once the Source<TOut, TMat> is cancelled, the Hub is considered closed and any new producers using the Sink<TIn, TMat> will be cancelled.
Declaration
public static Source<T, Sink<T, NotUsed>> Source<T>()
Returns
Type | Description |
---|---|
Source<T, Sink<T, NotUsed>> | TBD |
Type Parameters
Name | Description |
---|---|
T | TBD |
Source<T>(Int32)
Creates a Source<TOut, TMat> that emits elements merged from a dynamic set of producers. After the Source<TOut, TMat> returned by this method is materialized, it returns a Sink<TIn, TMat> as a materialized value. This Sink<TIn, TMat> can be materialized arbitrary many times and each of the materializations will feed the elements into the original Source<TOut, TMat>.
Every new materialization of the Source<TOut, TMat> results in a new, independent hub, which materializes to its own Sink<TIn, TMat> for feeding that materialization.
If one of the inputs fails the Sink<TIn, TMat>, the Source<TOut, TMat> is failed in turn (possibly jumping over already buffered elements). Completed Sink<TIn, TMat>s are simply removed. Once the Source<TOut, TMat> is cancelled, the Hub is considered closed and any new producers using the Sink<TIn, TMat> will be cancelled.
Declaration
public static Source<T, Sink<T, NotUsed>> Source<T>(int perProducerBufferSize)
Parameters
Type | Name | Description |
---|---|---|
Int32 | perProducerBufferSize | Buffer space used per producer. Default value is 16. |
Returns
Type | Description |
---|---|
Source<T, Sink<T, NotUsed>> | TBD |
Type Parameters
Name | Description |
---|---|
T | TBD |