relayrides/pushy — pull request #124 by jchambers (2014-09-24 17:12:23+00:00)
Title: Feedback service listener

This introduces the notion of an `ExpiredTokenListener`. Callers register listeners with a `PushManager`, then receive tokens asynchronously after a call to `PushManager#requestExpiredTokens`. Previously, `PushManager#getExpiredTokens` was a blocking call, and this led to issues where we could accidentally block other IO threads for a long time (see #71).

Technically, we don't need to move to a fully asynchronous model to avoid blocking IO threads, but this seems like it's more in keeping with what we do everywhere else.

One consequence of all of this is that `ApnsConnection` and `FeedbackServiceConnection` are now *very* similar from a structural perspective. I'd like to have them share an abstract base class in the future (and, as a result, common unit tests, listeners, etc.), but that can and should happen as a separate effort.