Sha256: 884a8accb89b132363c788cf6405142983c0ba2ebce9126736454f7c7d564e4a

Contents?: true

Size: 980 Bytes

Versions: 2

Compression:

Stored size: 980 Bytes

Contents

package com.twitter.birdname

import com.twitter.util._
import java.util.concurrent._

class BirdNameServiceImpl(config: BirdNameServiceConfig) extends BirdNameService {
  val serverName = "BirdName"
  val thriftPort = config.thriftPort
  
  /**
   * These services are based on finagle, which implements a nonblocking server.  If you 
   * are making blocking rpc calls, it's really important that you run these actions in
   * a thread pool, so that you don't block the main event loop.  This thread pool is only
   * needed for these blocking actions.  The code looks like:
   *
   *     // Depends on com.twitter.util >= 1.6.10
   *     val futurePool = new FuturePool(Executors.newFixedThreadPool(config.threadPoolSize))
   * 
   *     def hello() = futurePool {
   *       someService.blockingRpcCall
   *     }
   * 
   */   
    
  // TODO: Please implement your api.  You should have already created your thrift definition.
  
  def hello() = {
    Future("world")
  }

}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
scala-bootstrapper-0.1.2 lib/template/src/main/scala/com/twitter/birdname/BirdNameServiceImpl.scala.erb
scala-bootstrapper-0.1.1 lib/template/src/main/scala/com/twitter/birdname/BirdNameServiceImpl.scala.erb