An abstract class version of the above for java compatibility.
An address identifies the location of an object--it is a bound name.
Default implementation for WriteException that wraps an underlying exception.
RPC clients with Req
-typed requests and Rep
typed replies.
Clients
Information about a client, passed to a Service factory for each new connection.
Superclass for all codecs.
A combined codec factory provides both client and server codec factories in one (when available).
A ContextHandler is responsible for maintaining a context.
A Filter acts as a decorator/transformer of a service.
A mixin trait to assign a
to the group.name
Trait ListeningServer represents a bound and listening server.
A name identifies an object.
Request failures (eg.
A resolver binds a name, represented by a string, to a variable address.
Servers implement RPC servers with Req
-typed requests and
Rep
-typed responses.
Servers
A Service is an asynchronous function from Request to Future[Response].
A simple proxy ServiceFactory that forwards all calls to another ServiceFactory.
A ServiceFactoryWrapper adds behavior to an underlying ServiceFactory.
A simple proxy Service that forwards all calls to another Service.
Indicates that the connection was not established within the timeouts.
Marker trait to indicate there was an exception while writing the request.
A group is a dynamic set of T
-typed values.
(Since version 6.7.5) use ServiceFactoryProxy instead
A context is a piece of serializable metadata managed by a registered handler.
An empty ListeningServer that can be used as a placeholder.
Package netty3 implements the bottom finagle primitives: {{com.
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:
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:
Building an HTTP client is also simple. (Note that type annotations are added for illustration.)
Http.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.