Description
What is the reason for the API not using the same subscription model as the SPI? I believe it's about trying to allow libraries to be as generic as possible, but it seems to have gone to an extreme that loses all point of having types since these communicate little to nothing (particularly the empty Consumer
type).
The Producer.produceTo(consumer)
signature does not communicate lifecycle at all (since Consumer
has no methods on it) and this is a critical aspect of a stream since terminal states (onComplete
and onError
) can and will occur.
If the intent is to have Producer
/Consumer
types exposed to library users, at this point they are so generic as to be useless in communicating any intent. Thus, each library will need to hide these behind their own interfaces and they become little different than the SPI.
In short, what's the point of the API types (Consumer
and Producer
) in their current form?