Fetcher actors
The workhorse of our application is the fetcher, the actor responsible for fetching the follower details from GitHub. In the first instance, our actor will accept a single message, Fetch(user)
. It will fetch the followers corresponding to user
and log the response to screen. We will use the recipes developed in Chapter 7, Web APIs, to query the GitHub API with an OAuth token. We will inject the token through the actor constructor.
Let's start with the companion object. This will contain the definition of the Fetch(user)
message and two factory methods to create the Props
instances. You can find the code examples for this section in the chap09/fetchers_alone
directory in the sample code provided with this book (https://github.com/pbugnion/s4ds ...
Get Scala for Data Science now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.