3 Pulsar Functions
This chapter covers
- Introduction to the Pulsar Functions framework
- The Pulsar Functions programming model and API
- Writing your first Pulsar Function in Java
- Configuring, submitting, and monitoring a Pulsar Function
In our previous chapter, we started to see how you can work with Pulsar from the command line and from a Java client. Now, we are going to expand on those concepts and look at designing various solutions with Pulsar. As a starting point, lets revisit the requirements from the scenario we presented in the previous chapter.
Your team has been tasked with the development of a real-time leaderboard that will track player scores from around the world and display them back in the game itself. Allowing players to compare their scores to others. This leaderboard has must track the real-time gaming sessions of tens of thousands of players concurrently, that are spread across multiple countries. It must be updated immediately after any players score has changed due to events that happen during their gaming session, and the updated value must be broadcast back to all of the players.
In our initial design, the gaming sessions will be responsible for publishing each player’s scoring events to the “Game Score” topic, as you shown in Figure 3.1. Our application will consume these events to perform the necessary calculations and publish the results to the “LeaderBoard” topic for the gaming sessions to consume from.