Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

This code refers to a blog post I made about using Scala case classes to implement states within a state machine

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 src
Octocat-spinner-32 .gitignore
Octocat-spinner-32 pom.xml
Octocat-spinner-32 streaming-state-machine.iml

Twitter Streaming State Machine

Twitter requires users of the Streaming API to reconnect at most every few minutes. This calls for a state machine to control the actual reconnection. The code in this repository refers to a blog post I made which is available at Scala Case Classes and State Machines Using Akka Actors

Running the code

$ mvn compile exec:java -Dexec.mainClass=seevibes.Main

The code in this repository is slightly different from the blog post: the time scale was changed such that developers don't wait minutes before seeing a change. Since this code doesn't connect to Twitter, it doesn't really matter how long we wait before we actually change the keywords.

Something went wrong with that request. Please try again.