This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.twitter.finagle.Service; | |
| import com.twitter.finagle.SimpleFilter; | |
| import com.twitter.util.Future; | |
| public class MyThriftRequest { public int Attribute = 123; } | |
| public class LoggingFilter extends SimpleFilter<MyThriftRequest, MyThriftResponse> { | |
| private static final Logger LOG = Logger.getLogger(LoggingFilter.class); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| lazy val root = (project in file(".")). | |
| settings( | |
| name := "My Project", | |
| version := "1.0", | |
| scalaVersion := "2.11.6" | |
| ) | |
| libraryDependencies += "com.twitter" % "util-core_2.11" % "6.23.0" | |
| libraryDependencies += "org.scalatest" %% "scalatest" % "2.2.1" % "test" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // no external dependencies, just :paste the entire gist into a scala 2.11 repl | |
| // scala> import State._ | |
| // scala> StackExample.computed.run(List.empty) | |
| // #result of push(1), push(2), push(3), pop() | |
| // res0: (List[Int], Option[Int]) = (List(2, 1),Some(3)) | |
| // #naive fibonacci impl | |
| // scala> time(FibExample.fib(42)) | |
| // took 1204 ms |
OlderNewer