This interface represents a factory for
Publishers. An implementation of this interface is able to
create a stream given an implementation of
StreamId and a
DiscoveryService. During the creation of a
stream it is allowed to discover other streams. This allow the possibility to create streams that merge other streams
while performing transformations.
NOTE: it is not allowed to discover other streams using the provided
DiscoveryService in
multiple threads. In other words, do not use new threads inside the stream creation. The provided
DiscoveryService checks that subsequent discoveries are performed on the same thread, otherwise an exception
is risen. It is not possible to enforce the single thread execution in the
create(StreamId, DiscoveryService) method, but using the
DiscoveryService from different threads may
lead to unpredictable behavior and can cause deadlocks.