trait StackServer[Req, Rep] extends StackBasedServer[Req, Rep] with Parameterized[StackServer[Req, Rep]] with Transformable[StackServer[Req, Rep]]
A com.twitter.finagle.Server that composes a com.twitter.finagle.Stack.
- See also
ListeningServer for a template implementation that tracks session resources.
- Alphabetic
- By Inheritance
- StackServer
- StackBasedServer
- Transformable
- Parameterized
- Server
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def params: Params
The current parameter map used in this StackServer.
The current parameter map used in this StackServer.
- Definition Classes
- StackServer → Parameterized
- abstract def serve(addr: SocketAddress, service: ServiceFactory[Req, Rep]): ListeningServer
Serve
service
ataddr
Serve
service
ataddr
- Definition Classes
- Server
- abstract def stack: Stack[ServiceFactory[Req, Rep]]
The current stack used in this StackServer.
- abstract def withParams(ps: Params): StackServer[Req, Rep]
- Definition Classes
- StackServer → Parameterized
- abstract def withStack(stack: Stack[ServiceFactory[Req, Rep]]): StackServer[Req, Rep]
A new StackServer with the provided Stack.
A new StackServer with the provided Stack.
- See also
withStack
that takes aFunction1
for a more ergonomic API when used with method chaining.
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def configured[P](psp: (P, Param[P])): StackServer[Req, Rep]
Java friendly API for
configured
.Java friendly API for
configured
.The
Tuple2
can often be created by calls to amk(): (P, Stack.Param[P])
method on parameters (see com.twitter.finagle.loadbalancer.LoadBalancerFactory.Param.mk() as an example).- Definition Classes
- Parameterized
- def configured[P](p: P)(implicit sp: Param[P]): StackServer[Req, Rep]
Add the parameter,
p
, to the current Params.Add the parameter,
p
, to the current Params.Java users may find it easier to use the
Tuple2
version below.- Definition Classes
- Parameterized
- def configuredParams(newParams: Params): StackServer[Req, Rep]
Adds all parameters,
newParams
, to the current Params.Adds all parameters,
newParams
, to the current Params.- Definition Classes
- Parameterized
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def serve(addr: String, service: Service[Req, Rep]): ListeningServer
Serve
service
ataddr
Serve
service
ataddr
- Definition Classes
- Server
- final def serve(addr: String, service: ServiceFactory[Req, Rep]): ListeningServer
Serve
service
ataddr
Serve
service
ataddr
- Definition Classes
- Server
- final def serve(addr: SocketAddress, service: Service[Req, Rep]): ListeningServer
Serve
service
ataddr
Serve
service
ataddr
- Definition Classes
- Server
- def serveAndAnnounce(name: String, service: Service[Req, Rep]): ListeningServer
Serve
service
ataddr
and announce withname
.Serve
service
ataddr
and announce withname
. Announcements will be removed when the service is closed. Omitting theaddr
will bind to an ephemeral port.- Definition Classes
- Server
- def serveAndAnnounce(name: String, service: ServiceFactory[Req, Rep]): ListeningServer
Serve
service
ataddr
and announce withname
.Serve
service
ataddr
and announce withname
. Announcements will be removed when the service is closed. Omitting theaddr
will bind to an ephemeral port.- Definition Classes
- Server
- def serveAndAnnounce(name: String, addr: String, service: Service[Req, Rep]): ListeningServer
Serve
service
ataddr
and announce withname
.Serve
service
ataddr
and announce withname
. Announcements will be removed when the service is closed. Omitting theaddr
will bind to an ephemeral port.- Definition Classes
- Server
- def serveAndAnnounce(name: String, addr: String, service: ServiceFactory[Req, Rep]): ListeningServer
Serve
service
ataddr
and announce withname
.Serve
service
ataddr
and announce withname
. Announcements will be removed when the service is closed. Omitting theaddr
will bind to an ephemeral port.- Definition Classes
- Server
- def serveAndAnnounce(name: String, addr: SocketAddress, service: Service[Req, Rep]): ListeningServer
Serve
service
ataddr
and announce withname
.Serve
service
ataddr
and announce withname
. Announcements will be removed when the service is closed. Omitting theaddr
will bind to an ephemeral port.- Definition Classes
- Server
- def serveAndAnnounce(name: String, addr: SocketAddress, service: ServiceFactory[Req, Rep]): ListeningServer
Serve
service
ataddr
and announce withname
.Serve
service
ataddr
and announce withname
. Announcements will be removed when the service is closed. Omitting theaddr
will bind to an ephemeral port.- Definition Classes
- Server
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def transformed(t: Stack.Transformer): StackServer[Req, Rep]
- Definition Classes
- StackServer → Transformable
- See also
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def withStack(fn: (Stack[ServiceFactory[Req, Rep]]) => Stack[ServiceFactory[Req, Rep]]): StackServer[Req, Rep]
A new StackServer using the function to create a new Stack.
A new StackServer using the function to create a new Stack.
The input to
fn
is the client's current stack. This API allows for easier usage when writing code that uses method chaining.This method is similar to transformed while providing easier API ergonomics for one-off
Stack
changes.From Scala:
import com.twitter.finagle.Http Http.server.withStack(_.prepend(MyStackModule))
From Java:
import com.twitter.finagle.Http; import static com.twitter.util.Function.func; Http.server().withStack(func(stack -> stack.prepend(MyStackModule)));
- See also
withStack(Stack)
Example: