Operator concurrency primitives: subscription-containers (part 2)
IntroductionIn this blog post, I'm going to implement two, lock-free versions of the TwoSubscriptions container from the previous post. Although they will be functionally equivalent, the implementation...
View ArticleOperator concurrency primitives: subscription-containers (part 3 - final)
IntroductionIn this final part about subscription-containers, I'm going to demonstrate an array-backed container based on the copy-on-write approach and atomics.Why is this type of container so...
View ArticleSchedulers (part 1)
IntroductionSchedulers are the key to asynchronous and concurrent computations in RxJava. Although many standard schedulers exist and you can wrap an Executor into a scheduler, it is worth...
View ArticlePitfalls of operator implementations (part 3)
IntroductionIn this series, I put a spotlight onto some common and some less common yet sneaky pitfalls of operator implementations. Now that we know more about producers, subscription-containers and...
View ArticleSchedulers (part 2)
IntroductionIn the previous post, I've show how one can build a custom scheduler mainly based on existing RxJava classes.In this post, I'm going deeper and show how one can control the interaction...
View ArticleSchedulers (part 3)
IntroductionIn this blog post, I'm going to talk about the case when one wants to wrap an existing multi-threaded Executor and ensure the contracts on Scheduler and Worker are enforced in some...
View ArticleSchedulers (part 4 - final)
IntroductionIn this final blog post about Schedulers, I'll talk a bit about services which don't expose any ExecutorService facilities, such as when one needs to interact with GUI event loops.Working...
View ArticleThe Reactive-Streams API (part 1)
IntroductionThe Reactive-Streams API, heavily influenced by RxJava, is (in my opinion) the most beautiful API describing (a)synchronous, cancellable and backpressure-able dataflows to date, replacing...
View ArticleThe Reactive-Streams API (part 2)
IntroductionIn this blog post, I'm going to take our SingleProducer and SingleDelayedProducer classes and convert them into a reactive-streams based Subscriptions.At first, one might think the...
View ArticleThe Reactive-Streams API (part 3)
IntroductionIn this episode, I'm going to talk about how the rx.Subscriber's ability to register resources with it can be converted into the Reactive-Streams API. However, since RS doesn't specify any...
View ArticleThe Reactive-Streams API (part 4 - final)
IntroductionIn this final post about the Reactive-Streams API, I'm going to talk about the perhaps surprising trend that one needs a SubscriberArbiter (the cousin of ProducerArbiter) very frequently,...
View ArticleSubjects (part 1)
IntroductionI have the feeling many would like to bury Subjects and I'm yet going to do a multi-post series about them.Some consider them the mutable state of the reactive world, which I don't disagree...
View ArticleSubjects (part 2)
IntroductionSorry for the delay in posting, I was busy with my professional work and I've been implementing a fully reactive-streams compliant RxJava 2.0 in the meantime.In this blog post, I'm going to...
View ArticleSubjects (part 3 - final)
IntroductionIn this final part about Subjects, I'll show how to implement a PublishSubject. To make things a bit interesting, I'll implement it in a way that prevents PublishSubject overflowing its...
View ArticleOperator internals: introduction
Developing an operator is usually a non-trivial task. In the Advanced RxJava blog, I've tried to convey many of the foundational elements and experience I've got from building them.However, RxJava has...
View ArticleOperator internals: Amb, AmbWith
IntroductionThe amb operator, shorthand for ambiguous, subscribes to a set of source Observables and keeps relaying events from the first Observable that signaled any event while unsubscribing and...
View ArticleOperator internals: All, Any, Exists
IntroductionThe operator all checks if a given condition (predicate) holds for all elements of the upstream, emitting a single true value at the end, or emits false immediately if the predicate returns...
View ArticleConnectableObservables (part 1)
IntroductionWe learned about constructing cold (i.e., range) and hot observables (i.e., UnicastSubject) but nothing specific so far about how to convert between the two.Clearly, since subjects are also...
View ArticleOperator internals: AutoConnect
IntroductionThe operator autoConnect is a member of the ConnectableObservable class and allows triggering the connection to the underlying ConnectableObservable once the specified amount of subscribers...
View ArticleConnectableObservables (part 2)
IntroductionIn the previous post, I've shown how one can write a "simple"ConnectableObservable that uses a Subject to dispatch events to subscribers once it has been connected.The shortcoming of the...
View Article