Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update thrift and scrooge version to make project compile again. #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ project/plugins/project/
# Scala-IDE specific
.scala_dependencies
.worksheet
client/.idea/*
server/.idea/*
22 changes: 10 additions & 12 deletions client/build.sbt
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
name := "finagle-thrift-client-sample"
// import com.twitter.scrooge.ScroogeSBT
import sbt.Keys.libraryDependencies

version := "1.0.0"
name := "quickstart-client"

scalaVersion := "2.10.4"
version := "1.0"
scalaVersion := "2.11.6"

resolvers ++= Seq(
"Twitter repository" at "http://maven.twttr.com"
)
lazy val app = project.in(file("."))
.settings(
libraryDependencies += "com.twitter" %% "finagle-http" % "19.11.0",
libraryDependencies += "com.twitter" %% "finagle-thrift" % "19.11.0"
)

libraryDependencies ++= Seq(
"com.twitter" %% "scrooge-core" % "3.17.0",
"com.twitter" %% "finagle-thrift" % "6.24.0"
)

com.twitter.scrooge.ScroogeSBT.newSettings
4 changes: 1 addition & 3 deletions client/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
scalaVersion := "2.10.4"

addSbtPlugin("com.twitter" %% "scrooge-sbt-plugin" % "3.16.3")
addSbtPlugin("com.twitter" % "scrooge-sbt-plugin" % "19.11.0")
4 changes: 2 additions & 2 deletions client/src/main/scala/FinagleThriftClientSampleApp.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import java.util.concurrent.atomic.AtomicInteger

import com.twitter.conversions.time._
import com.twitter.conversions.DurationOps._
import com.twitter.finagle.Thrift
import com.twitter.finagle.util.DefaultTimer
import com.twitter.util.{Await, Duration, Future, Stopwatch}
Expand All @@ -14,7 +14,7 @@ object FinagleThriftClientSampleApp extends App {
// Q: what may happened if the server is not started ? ... after using
// and understanding better the code, try to add error handling for the
// case that the server is not available
val client = Thrift.newIface[SampleService.FutureIface]("localhost:8080")
val client = Thrift.client.newIface[SampleService.FutureIface]("localhost:8080")

// For having some fun, let's create a counter for tracing how many
// requests we are performing. An atomic object is required to
Expand Down
22 changes: 11 additions & 11 deletions server/build.sbt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name := "finagle-thrift-server-sample"
// import com.twitter.scrooge.ScroogeSBT
import sbt.Keys.libraryDependencies

version := "1.0.0"
name := "quickstart-server"

scalaVersion := "2.10.4"
version := "1.0"
scalaVersion := "2.11.6"

lazy val app = project.in(file("."))
.settings(
libraryDependencies += "com.twitter" %% "finagle-http" % "19.11.0",
libraryDependencies += "com.twitter" %% "finagle-thrift" % "19.11.0"
)

resolvers ++= Seq(
"Twitter repository" at "http://maven.twttr.com"
)

libraryDependencies ++= Seq(
"com.twitter" %% "scrooge-core" % "3.17.0",
"com.twitter" %% "finagle-thrift" % "6.24.0"
)

com.twitter.scrooge.ScroogeSBT.newSettings
4 changes: 1 addition & 3 deletions server/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
scalaVersion := "2.10.4"

addSbtPlugin("com.twitter" %% "scrooge-sbt-plugin" % "3.16.3")
addSbtPlugin("com.twitter" % "scrooge-sbt-plugin" % "19.11.0")
11 changes: 5 additions & 6 deletions server/src/main/scala/FinagleThriftServerSampleApp.scala
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
import com.twitter.finagle.ListeningServer
import com.sample.thrift.{SampleRequest, SampleResponse, SampleService}
import com.twitter.finagle.Thrift
import com.twitter.util.{Await, Future, Promise}
import com.twitter.util.{Await, Future}


import com.sample.thrift._

object FinagleThriftServerSampleApp extends App {

// The server part is easy in this sample, so let's just
// create a simple implementation
val service = new SampleService[Future] {
val service: SampleService[Future] = new SampleService[Future] {
def greet(request: SampleRequest): Future[SampleResponse] = {
val response = SampleResponse(greeting = "Hello " + request.name)
Future.value(response)
}
}

// Run the service implemented on the port 8080
val server = Thrift.serveIface(":8080", service)
val server = Thrift.server.serveIface(":8080",service)

// Keep waiting for the server and prevent the java process to exit
// Q: What happens if we remove the await ?
Expand Down