Flow(x).map(x => Flow(...)) type of setups would previously use the
generator incorrectly if the streams were created within an actor. This
is fixed now by making all stream-support actors set a ThreadLocal which
tells ActorBasedProcessorGenerator to override its contained
ActorRefFactory with the locally provided one.
Stream as a name is taken, so we use Flow (which does not happen to be
in scope for every Scala program already). This also makes it clear that
this constructs just the the pipe, which needs to be activated to become
a Producer.
Then, the different language bindings need to live in different
packages, otherwise they would not be able to use the same name of the
central abstraction. The plan is to use scala_api, java_api and
java8_api, for starters.
The ActorProducer is an actor-based Publisher which runs a thunk of code
until Stop is thrown. This means that completion is only signaled if
demand is present for one more element, which makes sense and it legal
according to the wording of the spec. The TCK was too strict in this
regard and has been relaxed.
Things would have “worked” without the relaxation if I had not also
fixed the output buffer management. SubscriptionManagement in
collaboration with the ResizableMultiReaderRingBuffer previously
generated demand on its own, acting like a true buffer. This is
undesired since we want to auto-tune the input buffers, which would get
a lot more complicated and instable with autonomously buffering output
stages in the mix.
Removing this extra-buffering uncovered several places in the test suite
which implicitly relied on this, which were fixed as well.
StreamImpl.scala grew too big, so I split it up into producer, consumer,
processor, messages and processor generator files. Also unified the way
processors and consumers are created (ActorConsumer.props,
ActorProcessor.props).
Implement toFuture based on transformRecover and consume.
- intercept messages which are expected
- log failures encountered in ActorProcessorImpl in addition to sending
them downstream
- remove the need to control reentrancy of pump() by only calling it
from Receive blocks
@drewhk: you might want to take a look at this commit