Conversation
…ubscriber into Subscriber.Sync, add tests
|
Guys, the star of this release is |
|
There is a failing test, not sure why: monix.tckTests.PublisherTest. See travis-ci/push. |
|
@aoprisan it's probably just a timeout due to the system being overloaded with stuff being executed in parallel by SBT, the |
|
I had a look on the PR and it looks great. To be honest, I have to revisit it as I am not sure I fully got all that is going on there :). |
There are 2 API-breaking changes:
SyncObservermoves toObserver.Sync(trait becomes part of theObservercompanion)SyncSubscribermoves toSubscriber.Sync(trait becomes part of theSubscribercompanion)But the major addition is to introduce the
Consumertype. TheConsumertype is a factory of subscribers. The problems we are trying to solve:Observer(andSubscriber) instances are stateful and error prone - for example, by contract, with an observer instance you can subscribe to a single data-sourcefoldLeftand thenrunAsyncGetFirstor something along those lines, but those operators are usually meant for pure functions and there is no standard way to describe consumers that consume some streams and then finally produce a result - like for example a consumer that writes into a NIO async file channel and then when the stream is finished to return some statistics, like the number of bytes written to diskMeet the
Consumer. TheConsumeris a factory ofSubscriberinstances with benefits: