Packages

  • package root
    Definition Classes
    root
  • package com
    Definition Classes
    root
  • package twitter

    Start with com.twitter.finagle.

    Definition Classes
    com
  • package finagle

    Finagle is an extensible RPC system.

    Finagle is an extensible RPC system.

    Services are represented by class com.twitter.finagle.Service. Clients make use of com.twitter.finagle.Service objects while servers implement them.

    Finagle contains a number of protocol implementations; each of these implement Client and/or com.twitter.finagle.Server. For example, Finagle's HTTP implementation, com.twitter.finagle.Http (in package finagle-http), exposes both.

    Thus a simple HTTP server is built like this:

    import com.twitter.finagle.{Http, Service}
    import com.twitter.finagle.http.{Request, Response}
    import com.twitter.util.{Await, Future}
    
    val service = new Service[Request, Response] {
      def apply(req: Request): Future[Response] =
        Future.value(Response())
    }
    val server = Http.server.serve(":8080", service)
    Await.ready(server)

    We first define a service to which requests are dispatched. In this case, the service returns immediately with a HTTP 200 OK response, and with no content.

    This service is then served via the Http protocol on TCP port 8080. Finally we wait for the server to stop serving.

    We can now query our web server:

    % curl -D - localhost:8080
    HTTP/1.1 200 OK

    Building an HTTP client is also simple. (Note that type annotations are added for illustration.)

    import com.twitter.finagle.{Http, Service}
    import com.twitter.finagle.http.{Request, Response}
    import com.twitter.util.{Future, Return, Throw}
    
    val client: Service[Request, Response] = Http.client.newService("localhost:8080")
    val f: Future[Response] = client(Request()).respond {
      case Return(rep) =>
        printf("Got HTTP response %s\n", rep)
      case Throw(exc) =>
        printf("Got error %s\n", exc)
    }

    Http.client.newService("localhost:8080") constructs a new com.twitter.finagle.Service instance connected to localhost TCP port 8080. We then issue a HTTP/1.1 GET request to URI "/". The service returns a com.twitter.util.Future representing the result of the operation. We listen to this future, printing an appropriate message when the response arrives.

    The Finagle homepage contains useful documentation and resources for using Finagle.

    Definition Classes
    twitter
  • package http2
    Definition Classes
    finagle
  • package param
    Definition Classes
    http2
  • EncoderIgnoreMaxHeaderListSize
  • EnforceMaxConcurrentStreams
  • FrameLoggerNamePrefix
  • FrameLogging
  • HeaderSensitivity
  • HeaderTableSize
  • InitialWindowSize
  • MaxConcurrentStreams
  • MaxFrameSize
  • MaxHeaderListSize
  • NackRstFrameHandling
  • PriorKnowledge
  • package transport
    Definition Classes
    http2

package param

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. Protected

Type Members

  1. case class EncoderIgnoreMaxHeaderListSize(ignoreMaxHeaderListSize: Boolean) extends Product with Serializable

    A class for configuring the http/2 encoder to ignore MaxHeaderListSize.

    A class for configuring the http/2 encoder to ignore MaxHeaderListSize.

    This is useful when creating clients for testing the behavior of a server.

  2. final case class EnforceMaxConcurrentStreams(enabled: Boolean) extends Product with Serializable

    A class for configuring overrides to the default encoderEnforceMaxConcurrentStreams setting.

    A class for configuring overrides to the default encoderEnforceMaxConcurrentStreams setting. If enabled the encoder will queue frames if the maximum number of concurrent streams would otherwise be exceeded.

  3. case class FrameLoggerNamePrefix(loggerNamePrefix: String) extends Product with Serializable

    The logger name to be used for the root HTTP/2 frame logger.

    The logger name to be used for the root HTTP/2 frame logger. This allows each frame type to be turned on and off by changing the level of prefix.<FRAME_TYPE>, or turning everything on by changing the level of prefix. The HTTP/2 frame logger logs at the level TRACE, so you must set logger to that level to see the frame logs. The prefix if not set defaults to io.netty.handler.codec.http2.Http2MultiplexHandler

    loggerNamePrefix

    The name of the logger to be used as the root logger name for netty HTTP/2 frame logging.

  4. final case class FrameLogging extends Product with Serializable

    Whether or not HTTP/2 frame logging is enabled.

    Whether or not HTTP/2 frame logging is enabled.

    Defaults to disabled.

    See also

    Enabled and Disabled on companion class for getting instances.

  5. case class HeaderSensitivity(sensitivityDetector: (CharSequence, CharSequence) => Boolean) extends Product with Serializable

    A class for configuring the http/2 encoder to mark a header entry as sensitive or not.

    A class for configuring the http/2 encoder to mark a header entry as sensitive or not.

    Entries marked as sensitive will never be cached, and will be encoded as literals, either with a static huffman encoding or in cleartext.

  6. case class HeaderTableSize(headerTableSize: Option[StorageUnit]) extends Product with Serializable

    A class for configuring overrides to the default headerTableSize setting.

  7. case class InitialWindowSize(initialWindowSize: Option[StorageUnit]) extends Product with Serializable

    A class for configuring overrides to the default initialWindowSize setting.

  8. case class MaxConcurrentStreams(maxConcurrentStreams: Option[Long]) extends Product with Serializable

    A class for configuring overrides to the default maxConcurrentStreams setting.

  9. case class MaxFrameSize(maxFrameSize: Option[StorageUnit]) extends Product with Serializable

    A class for configuring overrides to the default maxFrameSize setting.

  10. case class MaxHeaderListSize(maxHeaderListSize: StorageUnit) extends Product with Serializable

    A class for configuring overrides to the default maxHeaderListSize setting.

  11. final case class NackRstFrameHandling extends Product with Serializable

    Whether or not com.twitter.finagle.http2.transport.common.Http2NackHandler is included in channel pipeline, which is responsible for converting NACKs to RST_STREAM frame.

    Whether or not com.twitter.finagle.http2.transport.common.Http2NackHandler is included in channel pipeline, which is responsible for converting NACKs to RST_STREAM frame.

    Defaults to enabled.

    See also

    Enabled and Disabled on companion class for getting instances.

  12. case class PriorKnowledge(enabled: Boolean) extends Product with Serializable

    A class eligible for configuring whether to use the http/2 "prior knowledge" protocol or not.

    A class eligible for configuring whether to use the http/2 "prior knowledge" protocol or not.

    Note that both client and server must be configured for prior knowledge.

Ungrouped