public class CreatorStreamFactory extends java.lang.Object implements CreatorProvidingService, StreamFactory
TypedStreamFactory specifically designed to create ReactiveStreams using StreamCreators. In
order to use the right StreamCreator for creating the ReactiveStream, it uses
ImmutableIdentifiedStreamCreator to map a specific StreamId to the correspondent
StreamCreator.StreamCreator,
ImmutableIdentifiedStreamCreator| Constructor and Description |
|---|
CreatorStreamFactory(java.lang.Iterable<IdentifiedStreamCreator<?>> identifiedCreators) |
| Modifier and Type | Method and Description |
|---|---|
<T> ErrorStreamPair<T> |
create(StreamId<T> newId,
DiscoveryService discoveryService)
|
<T> void |
provide(StreamId<T> id,
StreamCreator<T> streamSupplier)
Provides a
StreamCreator associated to the specified id. |
public CreatorStreamFactory(java.lang.Iterable<IdentifiedStreamCreator<?>> identifiedCreators)
public <T> ErrorStreamPair<T> create(StreamId<T> newId, DiscoveryService discoveryService)
StreamFactoryStreamId and a DiscoveryService this method creates a
Publisher. The provided DiscoveryService can be used to discover other streams that are
needed in the creation process (stream combination, transformation, etc.)
NOTE: it is strongly discouraged the use of multiple threads inside this method (see
TypedStreamFactory documentation).create in interface StreamFactorynewId - the id of the stream to creatediscoveryService - DiscoveryService which can be used by the factory to look up other streams
('upstream' of the one it will create)null if this factory cannot create the stream of the given idpublic <T> void provide(StreamId<T> id, StreamCreator<T> streamSupplier)
CreatorProvidingServiceStreamCreator associated to the specified id.provide in interface CreatorProvidingServiceid - the identifier of the stream that the StreamCreator will createstreamSupplier - the StreamCreator that is able to create the Flowable specified using
the given id