anchor.diff:  ====
   
   === How to lazily create Reactive Streams
  +You do not have to explicitly provide `Publisher` instances in the Streaming Pool. A common way of creating Reactive Streams is through the use of `StreamFactory`. A `StreamFactory` is a mechanism that is used to create a `Publisher` from a given `StreamId`. When looking for a `StreamId` that has not been provided using the `ProvidingService`, the framework checks if any registered `StreamFactory` is able to create it.
  +
  +Using this mechanism, a `Publisher` is created on-demand (lazily) if it is not already present in the Streaming Pool system. A `StreamFactory` is a class that implements the interface `StreamFactory` or `TypedStreamFactory`.
  +
  +==== Stream factory
  +[source,java]
  +----
  +<T> Optional<Publisher<T>> create(StreamId<T> id, DiscoveryService discoveryService);
  +----
  +A `StreamFactory` needs to implement the `create(...)` method in which they have to:
  +
  +1. decide if it can create a `Publisher` for the given `StreamId`
  +2. actually create the `Publisher` and return it
  +
  +During the stream creation, you have access to the `DiscoveryService` in the case you need to lookup other Reactive Streams. You should be aware though that circular dependencies during stream creation are detected and the discovery method will throw accordingly.
  +
  +*`StreamId` discovery is not thread-safe*, therefore it is *forbidden* to use different threads inside a `StreamFactory#create` method. This case is checked and Streaming Pool will throw an exception.
  +
  +[NOTE]
  +====
  +In case the `StreamFactory` is not able to create the current `StreamId`, by convention it must return an empty `Optional`.
  +====
  +
  +[IMPORTANT]
  +====
  +By method signature, the type of the `StreamId` and the type of the produced `Publisher` must match. Often, you will have your own types of `StreamId`, so after proper checking you can cast to your own instance of `StreamId`. Again, after the creation is ok to cast again the `Publisher` to a `Publisher<T>` to satisfy the Java compiler. This trick is needed, mostly, because of the generics implementation in Java.
  +====
  +
  +In order to use your `StreamFactory`, you have to register it. Streaming Pool makes extensive use of Spring dependency injection, and it collects all the objects that are implementing the `StreamFactory` interface in the context. Those Beans will be then registered in the Streaming Pool and they will be used in the discovery process if needed. Therefore, you just have to provide a Bean for your factories.
   
   === How discovery works
  +One of the key feature of Streaming Pool is the discovery of a Reactive Stream using the `DiscoveryService`.
  +
  +The discovery can be summarized by the following pseudo-code.
  +[source]
  +----
  +function discover(SteamId id)
  +
  +    if streamingPoolContains(id) <1>
  +        return getStreamFor(id)
  +    
  +    if not streamFactoriesCanCreate(id) <2>
  +        throws exception
  +
  +    return streamFactoriesCreate(id) <3>
  +----
  +<1> check if the `StreamId` is already present in the Streaming Pool and return it.
  +<2> if the stream cannot be created by any factory, then an error is thrown. In this case, make sure you are registering your `StreamFactory` correctly.
  +<3> a `StreamFactory` is able to create the Reactive Stream, so it the stream is created and registered in the Streaming Pool.
   
   == Examples
  +It is possible to find examples of the Streaming Pool features in the folder `src/examples` in the repository source code. The examples are expressed as JUnit tests and they can be run and modified. The goal is to provide a quickstart for understanding how Streaming Pool works.
   
  +We assume that you have a basic understanding of http://projects.spring.io/spring-framework/[Spring Framework] dependency injection using annotations.
  
positive.code:     public void anyMethod() {
          // ...
          Publisher<Double> deviceStream = createStream();
          providingService.discover(deviceStreamId, deviceStream);
          // ...
      }
  }
  
negative.code: The application (client) that uses a stream does not need to know which is the source of the information, it may be a component of the application itself or a distributed system. In this way, it is possible to create truly decoupled systems that are resilient to changes and are easy to mock or test.
  
  == Introduction
  A common use case in modern Software applications is to access the values from a particular source. In the context of Internet of Things the source can be a sensor or a device. In business applications the source can be a real time indicator or application state. At CERN a common problem is to listen for devices values of the control system of different machines.
  
  All these problems can be solved using the well-known Observable-Observer pattern or, recently, a reactive stream of the data. Streaming Pool assumes you want to use a Reactive Stream for accessing your data.
  
  There are technologies that already solve this problem, such as https://projectreactor.io/[Project Reactor] and https://github.com/ReactiveX/RxJava[RxJava]. They provide stream creation, manipulation and subscription capabilities and they are great. Streaming Pool sits on top of these technologies.
  
  The goal of Streaming Pool is to provide and discover Reactive Streams without having the knowledge of where they live (in the local VM or on a Server). The only knowledge you need to have is the ID or `StreamId` associated to the Reactive Stream you want to get.
  
  === StreamId
  A `StreamId` is an object that implements the `StreamId<T>` interface. The generic type indicates the type of the data in the Reactive Stream. For each `StreamId<T>` there is a corresponding `Publisher<T>` and we enforce to have a consistent type by design.
  
  Note that the `StreamId` interface is a marker interface, it is used as a key to distinguish `Publisher` instances in the Streaming Pool. Depending on your needs, the `StreamId` can be used to carry information about the characteristics of the Reactive Stream you want to get (especially useful in combination with a `StreamFactory`).
  
  [CAUTION]
  ====
  Since the `StreamId` acts as key in the Streaming Pool for the corresponding `Publisher` it *must implement* `equals(Object o)` and `hashCode()` methods. If it is not the case, the `Publisher` in the Streaming Pool will not be reused and the behavior could be unpredictable.
  ====
  
  === Discover a stream
  [source,java]
  