Skip to content

Instantly share code, notes, and snippets.

@mosesn
Created April 30, 2014 21:10
Show Gist options
  • Save mosesn/d6235cba5f8387b6d7cc to your computer and use it in GitHub Desktop.
Save mosesn/d6235cba5f8387b6d7cc to your computer and use it in GitHub Desktop.
Adding Filters jankily to the current scrooge interface
trait Iface {
def abyssTweet(tweet: Tweet): Future[Unit]
}
val instance: Iface
val abyssSvc: Service[Tweet, Unit] = Service.mk { tweet: Tweet => instance.abyssTweet(tweet) }
val timeoutFilter: TimeoutFilter[Tweet, Unit]
val retryingFilter: RetryingFilter[Tweet, Unit]
val filteredSvc: Service[Tweet, Unit] = retryingFilter andThen timeoutFilter andThen abyssSvc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment