Monix: Version 2.0-RC8 Released
This release candidate is probably the last one before 2.0, assuming
new bugs aren’t found. Amongst others, it introduces an awesome
Consumer type which makes it possible to describe composable
consumers. For a teaser:
// For processing sums in parallel, useless of course, but can become
// really helpful for logic sprinkled with I/O bound stuff
val consumer = Consumer
.loadBalance(parallelism=10, Consumer.foldLeft(Coeval(0L))(_ + _))
.map(_.sum)
val observable: Observable[Int] = ???
// Our consumer turns our observable into a Task processing sums, w00t!
val task: Task[Long] = observable.runWith(consumer)
// Consume the whole stream and get the result
task.runAsync.foreach(println)
See the published API Documentation.
Critical bug fix:
- BUG #181: the default operators
on
CancelableFutureare triggeringStackOverflowexceptions
New Features:
- Issue #184: introducing the
Consumertype, a factory of subscribers that makes it easier to specify reusable and composable consumers and for example, it makes it possible, out of the box, to load-balance the workload between multiple subscribers in parallel; see the description - Issue #186 (related to
issue #168): adds the
Observable.interleave2operator, similar with the one inFS2(former scalaz-streams) - Issue #180: the
Observer.feedfunction now has an overload that does not take a cancelable, because it’s awkward coming up with one if it isn’t needed; there’s also aonNextAllextension for bothObserverandSubscriberwhich can push a whole collection of events - Issue #187: integrates
the
MonadCombinetype-class from Cats, being similar to the ScalazMonadPlus, as somehow this was missed in the initial integration - Issue #177 reviews exposed
traits and abstract classes, making sure they inherit from
Serializable - Issue #85: small change,
clarifies the ScalaDoc on theRefCountCancelabletype - Issue #162: implements
the
Observable.takeUntil(trigger: Observable[Any])operator, an operator that takes from the source until another observable triggers an event - Issue #189: for
Observableoperators that return a single item (e.g.sumF,foldLeftF, etc.) adds variants that do the same thing, but returnTaskresults instead, so now we havefoldLeftL,sumL, etc. that return tasks - Issue #190: changes many
observable operators, that were taking by-name parameters or initial state
parameters (e.g.
headOrElseF,foldLeftF, etc), to takeCoevalparams instead, in order to have fine control over the evaluation model - Issue #191: introduces
by default an implicit conversion from
AnytoCoeval.Now, to make it easier to useCoevalas function parameters - the default will thus simply be strict evaluation, strictness being usually the default in Scala
This release we’ve got a new contributor: @leakyabstraction; W00t!
Enjoy!