Reactive Streams and Firebase Notifications

Stefano Troìa
The Startup
Published in
3 min readNov 27, 2019

--

Photo by Mohamed Nohassi on Unsplash

When building real-time applications based on data-streams is important to build non-blocking systems. If you are not familiar with these concepts it’s important to focus on data and operations we wan to perform on them.

In this example, we are building a piece of application that will submit notifications to mobile devices using Firebase APIs. This will perform only I/O-bound operations so the Reactive-programming approach sounds the best solution.

What is Reactive Programming?

It’s a programming paradigm based on data streams and the propagation of change, this means we are working on a dataset and we will perform operations only when an event is emitted. This is the best approach for async-programming because an event will be emitted when an operation is completed without using plenty of resources (for example active thread waiting for the operation to complete).

Requirements

For this example we are going to use:

Project Reactor

It’s an interesting framework that brings reactive programming in Java after javaRx. The pillars of this library are two…

--

--